#include <sicstus/sicstus.h> spio_t_error_code SP_fclose( SP_stream *stream, spio_t_bits close_options);
Close the stream.
SP_FCLOSE_OPTION_USER_STREAMSis set, see below.
Note that it is possible to close only one direction of a
bidirectional stream. The return value will tell whether the stream is
still open; see below.
Pass non-blocking option to lower level routines, including the call
SP_flush_output() that is issued when non-forcibly closing write
One possible use for this option is to perform a best effort
close, which falls back to using
SP_FCLOSE_OPTION_FORCE only if
ordinary close would block.
user_classof a user defined stream. When this option is passed, all currently opened streams of that class is closed, using the remaining option flags. E.g. to close all user defined streams of class my_class in the read direction only do:
On success, all specified directions has been closed. Since some direction may still be open, there are two possible return values on success:
On failure, returns a SPIO error code. Error codes with special meaning
SP_fclose() are the same as for
see. Other error codes may also be returned.
cpg-ref-SP_flush_output. Prolog Streams.