TextFileΒΆ
files.spad line 143 [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.
- close!: % -> %
from FileCategory(FileName, String)
- coerce: % -> OutputForm
from CoercibleTo OutputForm
- endOfFile?: % -> Boolean
endOfFile?(f)
tests whether the filef
is positioned after the end of all text. If the file is open for output, then this test is alwaystrue
.
- flush: % -> Void
from FileCategory(FileName, String)
- iomode: % -> String
from FileCategory(FileName, String)
- latex: % -> String
from SetCategory
- name: % -> FileName
from FileCategory(FileName, String)
- open: (FileName, String) -> %
from FileCategory(FileName, String)
- open: FileName -> %
from FileCategory(FileName, String)
- read!: % -> String
from FileCategory(FileName, String)
- readIfCan!: % -> Union(String, failed)
readIfCan!(f)
returns a string of the contents of a line from filef
, if possible. Iff
is not readable or if it is positioned at the end of file, then"failed"
is returned.
- readLine!: % -> String
readLine!(f)
returns a string of the contents of a line from the filef
.
- readLineIfCan!: % -> Union(String, failed)
readLineIfCan!(f)
returns a string of the contents of a line from filef
, if possible. Iff
is not readable or if it is positioned at the end of file, then"failed"
is returned.
- reopen!: (%, String) -> %
from FileCategory(FileName, String)
- writeLine!: % -> String
writeLine!(f)
finishes the current line in the filef
. An empty string is returned. The callwriteLine!(f)
is equivalent towriteLine!(f,"")
.
- writeLine!: (%, String) -> String
writeLine!(f, s)
writes the contents of the strings
and finishes the current line in the filef
. The value ofs
is returned.