#include <sicstus/sicstus.h> spio_t_error_code SP_fopen( char const *pathname, void *reserved, spio_t_bits options, SP_stream **pstream);
Opens a file and creates a SICStus stream reading and/or writing to it.
SP_expand_file_name()unless the option
SP_FOPEN_OPTION_NOEXPANDis specified, in which case the path must already have been expanded by
flush_output/1. In essence this ensures that the stream behaves as if it were unbuffered.
pathnamehas already been expanded with
SP_expand_file_name()or something similar. This implies that
pathnameis an absolute path. If this option is not specified,
pathnameis expanded with
*pstreamwill be set to the created stream.
*pstream will be set to the created stream and
SPIO_S_NOERR or some other success code returned.
On failure, some SPIO failure code will be returned. Error codes with
special meaning for
Other error codes may also be returned.