# TextFile¶

This domain provides an implementation of text files. Text is stored in these files using the native character set of the computer.

=: (%, %) -> Boolean
from BasicType
~=: (%, %) -> Boolean
from BasicType
close!: % -> %
from FileCategory(FileName, String)
coerce: % -> OutputForm
from CoercibleTo OutputForm
endOfFile?: % -> Boolean
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.
flush: % -> Void
from FileCategory(FileName, String)
hash: % -> SingleInteger
from SetCategory
hashUpdate!: (HashState, %) -> HashState
from SetCategory
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)
from FileCategory(FileName, String)
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.