The DEC-10 Prolog I/O predicates manipulate streams implicitly since they
only refer to current input/output streams (section 6.10.1).
The current input and output streams are initially set to
user_input and user_output respectively. The predicate
see/1
(resp. tell/1, append/1) can be used for setting the
current input (resp. output) stream to newly opened streams for
particular files. The predicate seen/0
(resp. told/0) close the current input (resp. output) stream,
and resets it to the standard input (resp. output). The predicate
seeing/1 (resp. telling/1) is used for retrieving
the file name associated with the current input (resp. output)
stream. The file name user stands for the standard input or
output, depending on context (user_input and
user_output can also be used). The DEC-10 Prolog I/O predicates
are only provided for compatibility, they are now obsolete and
their use is discouraged. The predicates for explicit stream manipulation
should be used instead (section 6.10).
see(FileName) sets the current input stream to FileName.
If there is a stream opened by see/1 associated with the same
FileName already, then it becomes the current input stream.
Otherwise, FileName is opened for reading and becomes the current
input stream.
tell(FileName) sets the current output stream to FileName.
If there is a stream opened by tell/1 associated with the same
FileName already, then it becomes the current output stream.
Otherwise, FileName is opened for writing and becomes the current
output stream.
append(FileName) like tell/1 but
FileName is opened for writing + append.
A stream-term (obtained with any other built-in predicate) can also be
provided as FileName to these predicates.
seeing(FileName) succeeds if FileName unifies
with the name of the current input file, if it was opened by
see/1; else with the current input stream-term, if this is not
user_input, otherwise with
user.
telling(FileName) succeeds if FileName unifies with the
name of the current output file, if it was opened by tell/1 or
append/1; else with the current output stream-term, if this is not
user_output, otherwise with user.
Errors
None.
Portability
GNU Prolog predicates.
6.16.4
seen/0,
told/0
Templates
seen told
Description
seen closes the current input, and resets it to
user_input.
told closes the current output, and resets it to
user_output.
get0(Code) succeeds if Code unifies with the next
character code read from the current input stream. Thus it is equivalent to
get_code(Code) (section 6.12.1).
get(Code) succeeds if Code unifies with the next character
code read from the current input stream that is not a layout character.
skip(Code) skips just past the next character code Code
from the current input stream.