current_input(
Stream)
unifies Stream with the current input
stream.
seeing(
S)
unifies
S with the current input stream. This is exactly the
same as current_input
(S), except that S will be unified
with a filename if the current input stream was opened by see/1
(see ref-iou-sfh-opn).
seeing/1
can be used to verify that FileNameOrStream is still the
current input stream as follows:
/* nonvar(FileNameOrStream), */ see(FileNameOrStream), ... seeing(FileNameOrStream)
If the current input stream has not been changed (or if changed, then
restored), the above sequence will succeed for all file names and all stream
objects opened by open/[3,4]
. However, it will fail for all stream objects
opened by see/1
(since only filename access to streams opened by
see/1
is supported). This includes the stream object user_input
(since the standard input stream is assumed to be opened by see/1
, and
so seeing/1
would return user
in this case).
seeing/1
can be followed by see/1
to ensure that a
section of code leaves the current input unchanged