FileCategory(Name, S)

files.spad line 1 [edit on github]

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.

=: (%, %) -> Boolean

from BasicType

~=: (%, %) -> Boolean

from BasicType

close!: % -> %

close!(f) returns the file f 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 file f. The input/output status of f may be “input”, “output” or “closed” mode.

latex: % -> String

from SetCategory

name: % -> Name

name(f) returns the external name of the file f.

open: (Name, String) -> %

open(s, mode) returns a file s open for operation in the indicated mode: “input” or “output”.

open: Name -> %

open(s) returns the file s open for input.

read!: % -> S

read!(f) extracts a value from file f. The state of f is modified so a subsequent call to read! will return the next element.

reopen!: (%, String) -> %

reopen!(f, mode) returns a file f reopened for operation in the indicated mode: “input” or “output”. reopen!(f,"input") will reopen the file f for input.

write!: (%, S) -> S

write!(f, s) puts the value s into the file f. The state of f is modified so subsequents call to write! will append one after another.

BasicType

CoercibleTo OutputForm

SetCategory