(open "myfile" "a") doesn't work as expe
Posted: Mon Apr 25, 2005 1:50 am
The following code:
fails with: value expected : (open "myfile" "a")
when the file "myfile" doesn't exist.
If you use (on Unix):
#touch myfile
And rerun the code above, it works as expected.
I would expect that a file opened for appending with "a"
or "append" would not require preexistence of the
file to start writing to it. This is the common usage,
at least on Unix systems.
Code: Select all
(device (open "myfile" "a"))
(print "This goes in myfile")
(close (device))
(exit)
when the file "myfile" doesn't exist.
If you use (on Unix):
#touch myfile
And rerun the code above, it works as expected.
I would expect that a file opened for appending with "a"
or "append" would not require preexistence of the
file to start writing to it. This is the common usage,
at least on Unix systems.