Availability:built-in
[ISO]close(+Stream)Close the specified stream. If Stream is not open, an
existence error is raised. See stream_pair/3
for the implications of closing a
stream pair.
If the closed stream is the current input, output or error stream,
the stream alias is bound to the initial standard I/O streams of the
process. Calling close/1
on the initial standard I/O streams of the process is a no-op for an
input stream and flushes an output stream without closing it.94This
behaviour was defined with purely interactive usage of Prolog in mind.
Applications should not count on this behaviour. Future versions may
allow for closing the initial standard I/O streams.