FileCategory(Name, S)¶
files.spad line 1 [edit on github]
Name: SetCategory
S: SetCategory
This category provides an interface to operate on files in the computer's
file system. The precise method of naming files is determined by the Name parameter. The type of the contents of the file is determined by S
.
- close!: % -> %
close!(f)
returns the filef
closed to input and output.
- coerce: % -> OutputForm
from CoercibleTo OutputForm
- flush: % -> Void
flush(f)
make sure that buffered data in written out to the operating system.
- iomode: % -> String
iomode(f)
returns the status of the filef
. The input/output status off
may be “input”, “output” or “closed” mode.
- latex: % -> String
from SetCategory
- name: % -> Name
name(f)
returns the external name of the filef
.
- open: (Name, String) -> %
open(s, mode)
returns a files
open for operation in the indicated mode: “input” or “output”.
- open: Name -> %
open(s)
returns the files
open for input.
- read!: % -> S
read!(f)
extracts a value from filef
. The state off
is modified so a subsequent call to read! will return the next element.
- reopen!: (%, String) -> %
reopen!(f, mode)
returns a filef
reopened for operation in the indicated mode: “input” or “output”.reopen!(f,"input")
will reopen the filef
for input.
- write!: (%, S) -> S
write!(f, s)
puts the values
into the filef
. The state off
is modified so subsequents call towrite!
will append one after another.