closes the input-/outputstream.
close/1 closes Stream, which may be an inputstream or an outputstream. If Stream is an outputstream, the buffer of the outputstream will be flushed before closing the stream.
Stream stream
Examples
close(Stream). Closes the stream and succeeds.
These predicates are part of the ISO-Prolog Standard.