8.1.6 DEC-10 Prolog File I/O

The following predicates manipulate files.

see(+File)
The file File becomes the current input stream. File may be a stream previously opened by see/1 or a file specification. In the latter case, the following action is taken: If there is a stream opened by see/1 associated with the same file already, then it becomes the current input stream. Otherwise, the file denoted by File is opened for input and made the current input stream.
seeing(?FileName)
FileName is unified with the name of the current input file, if it was opened by see/1, with the current input stream, if it is not user_input; otherwise, with user.
seen
Closes the current input stream, and resets it to user_input.
tell(+File)
The file File becomes the current output stream. File may be a stream previously opened by tell/1 or a file specification. In the latter case, the following action is taken: If there is a stream opened by tell/1 associated with the same file already, then it becomes the current output stream. Otherwise, the file denoted by File is opened for output and made the current output stream.
telling(?FileName)
FileName is unified with the name of the current output file, if it was opened by tell/1, with the current output stream, if it is not user_output; otherwise, with user.
told
Closes the current output stream, and resets it to user_output.