SP_fopen() #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_NOEXPAND is specified, in which case the
path must already have been expanded by SP_expand_file_name().
NULL.
SP_FOPEN_OPTION_READSP_FOPEN_OPTION_WRITESP_FOPEN_OPTION_APPENDSP_FOPEN_OPTION_BINARYSP_FOPEN_OPTION_TEXTSP_FOPEN_OPTION_AUTOFLUSHflush_output/1. In essence this ensures that the stream behaves
as if it were unbuffered.
SP_FOPEN_OPTION_INTERACTIVESP_FOPEN_OPTION_NOEXPANDpathname has already been expanded with
SP_expand_file_name() or something similar. This implies that
pathname is an absolute path. If this option is not
specified, pathname is expanded with
SP_expand_file_name() before use.
*pstream will be set to the created
stream.
On success, *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 SP_fopen():
SPIO_E_FILE_NOT_FOUNDSPIO_E_FILE_ACCESSSPIO_E_OPEN_ERROROther error codes may also be returned.