close(X) closes the stream corresponding to X,
where X should be a stream object created by open/[3,4],
or a file specification passed to see/1 or tell/1.
In the example:
see(foo),
...
close(foo)
foo will be closed. However, in the example:
open(foo, read, S),
...
close(foo)
an exception will be raised and foo will not be closed. See mpg-ref-close.
told/0 closes the current output stream. The current output stream is
then set to be user_output.
seen/0 closes the current input stream. The current input stream is
then set to be user_input.