files.spad line 131 [edit on github]
This domain provides an implementation of text files. Text is stored in these files using the native character set of the computer.
endOfFile?(f)
tests whether the file f
is positioned after the end of all text. If the file is open for output, then this test is always true
.
readIfCan!(f)
returns a string of the contents of a line from file f
, if possible. If f
is not readable or if it is positioned at the end of file, then "failed"
is returned.
readLine!(f)
returns a string of the contents of a line from the file f
.
readLineIfCan!(f)
returns a string of the contents of a line from file f
, if possible. If f
is not readable or if it is positioned at the end of file, then "failed"
is returned.
writeLine!(f)
finishes the current line in the file f
. An empty string is returned. The call writeLine!(f)
is equivalent to writeLine!(f,"")
.
writeLine!(f, s)
writes the contents of the string s
and finishes the current line in the file f
. The value of s
is returned.