- set_input(+F)
- ISO
- see(+F)
-
Makes file F the current input stream.
- If there is an open input stream associated with the file that
has F as its file name, and that stream was opened previously
by see/1, then it is made the current input stream.
- Otherwise, the specified file is opened for input and made the
current input stream. If the file does not exist, see/1
fails.
Also note that different file names (that is, names which do not unify)
represent different input streams (even if these different file names
correspond to the same file).
The implementation of the ISO preducate set_input/1, is
essentially that of see/1.
Exceptions:
- permission_error
- File F is directory or file is not readable.
- instantiation_error
- F is not instantiated at the time of call.
- existence_error
- File F does not exist.
- domain_error
- F is not an atomic file identifier
- seeing(?F)
-
F is unified with the name of the current input stream.
This is exactly the same with predicate current_input/1
described in Section 6.9, and it is only provided for
upwards compatibility reasons.
- seen
-
Closes the current input stream.
Current input reverts to ``userin'' (the standard input stream).
- set_output(+F)
- ISO
- tell(+F)
-
Makes file F the current output stream.
- If there is an open output stream associated with F
and that was opened previously
by tell/1, then that stream is made the current output
stream.
- Otherwise, the specified file is opened for output and made the
current output stream. If the file does not exist, it is created.
Also note that different file names (that is, names which do not unify)
represent different output streams (even if these different file names
correspond to the same file).
The implementation of the ISO preducate set_output/1, is
essentially that of tell/1.
Exceptions:
- permission_error
- File F does not have write permission, or is a directory.
- instantiation_error
- F is uninstantiated.
- domain_error
- F is not an atomic file identifier
- telling(?F)
-
F is unified with the name of the current output stream.
This predicate is exactly the same with predicate current_output/1
described in Section 6.9, and it is only provided for
upwards compatibility reasons.
- told
-
Closes the current output stream.
Current output stream reverts to ``userout'' (the standard output stream).
- open(+File,+Mode,-Stream)
- ISO
open/1 creates a stream for the file designated in File, and binds Stream to a structure representing that
stream. Mode can be one of either read to create an
input stream or write or append to create an output
stream. If the mode is write, the contents of File
are removed and File becomes a record of the output stream.
If the mode is append the output stream is appended to the
contents of File.
Exceptions (read mode)
- permission_error
- File F is directory or file is not readable.
- instantiation_error
- F is not instantiated at the time of call.
- existence_error
- File F does not exist.
Exceptions (write mode)
- permission_error
- File F does not have write permission, or is a directory.
- instantiation_error
- F is uninstantiated.
- open(+File,+Mode,-Stream.+Options)
- ISO
This predicate is implemented in XSB for partial ISO
compatability. In the case where Options is equal to [], open/4 is defined as open/3, otherwise it
aborts.
- close(+Stream)
- ISO
close/1 closes the stream Stream.
- close(+Stream.+Options)
- ISO
This predicate is implemented in XSB for partial ISO
compatability. In the case where Options is equal to
[], close/2 is defined as close/1, otherwise
it aborts.
- file_exists(+F)
-
Succeeds if file F exists. F must be instantiated to
an atom at the time of the call, or an error message is displayed on
the standard error stream and the predicate aborts.
Exceptions:
- instantiation_error
- F is uninstantiated.