13.7 The fileHandle type

close()
The close() method closes a file handle.

dump($x$)
The dump($x$) method stores a typeable ASCII representation of the object $x$ to a file. Note that this method has no checking for recursive hierarchical data structures.

eof()
The eof() method returns a boolean flag to indicate whether the end of a file has been reached.

flush()
The flush() method flushes any buffered data which has not yet physically been written to a file.

getPos()
The getPos() method returns a file handle’s current position in a file.

isOpen()
The isOpen() method returns a boolean flag indicating whether a file is open.

read()
The read() method returns the contents of a file as a string.

readline()
The readline() method returns a single line of a file as a string.

readlines()
The readlines() method returns the lines of a file as a list of strings.

setPos($x$)
The setPos($x$) method sets a file handle’s current position in a file.

write($x$)
The write($x$) method writes the string $x$ to a file.