current_output(
Stream)
unifies Stream with the current output
telling(
S)
unifies
S with the current output stream. This is exactly the
same as current_output
(S), except
that S will be unified
with a filename if the current output stream was opened by tell/1
.
A common usage of telling/1
is
tell('Some File Name') ... telling('Some File Name')
telling/1
should succeed if the current input stream was not changed (or
if changed, restored).
It succeeds for any filename (including user
) and any stream object opened
by open/3
(see ref-iou-sfh-opn), but fails for user_output
and any stream
object opened by tell/1
(see ref-iou-sfh-opn). Passing
file names to tell/1
is the only DEC-10 Prolog
usage of telling/1
, so SICStus Prolog is compatible with this usage.
WARNING: The sequence
telling(File), ... set_output(File),will signal an error if the current output stream was opened by
tell/1
. The only sequences that are guaranteed to succeed aretelling(FileOrStream), ... tell(FileOrStream)and
current_output(Stream), ... set_output(Stream)