openFile(path, mode)
openFile :: File(path : string, mode : string)
Opens a file and returns a File handle. Mode follows C conventions: "r" (read), "w" (write/create), "a" (append), "r+" (read+write), "w+" (create+read+write). Check .isOpen to confirm the file opened successfully.
closeFile(f)
closeFile :: (f : File)
Closes the file and releases the handle.
readAll(f)
readAll :: string(f : File)
Reads the entire contents of the file and returns it as a string.
readLine(f)
readLine :: string(f : File)
Reads one line from the file (up to 4095 characters). Returns an empty string at end of file.
atEnd(f)
atEnd :: bool(f : File)
Returns true if the file position is at end of file.
writeFile(f, s)
writeFile :: (f : File, s : string)
Writes a string to the file.
writeLine(f, s)
writeLine :: (f : File, s : string)
Writes a string followed by a newline to the file.
deleteFile(path)
deleteFile :: bool(path : string)
Deletes the file at the given path. Returns true on success.