Next: , Previous: System_boolean, Up: System


3.2.1.2 System.file

Implements: see System_object

Represents a disk file.

Supported constructors:

System.file(filename, mode)
Opens filename using the given mode. mode is a string up to two bytes long, with the first byte containing "r", "w", or "a" (read, write or append, repsectively), followed by an optional "+" symbol to open for both read and write.

Supported methods:

readline()
Reads a line of text from the file. Returns null if end of file is reached.
read(bytes)
Reads up to bytes from the file. Returns null if end of file is reached.
write(string)
Writes given string to the file.
seek(pos)
Seeks to position pos in the file.
close()
Closes the file.