Initializing help system before first use

XPRDsetdefstream

XPRDsetdefstream


Purpose
Set default input/output streams.
Synopsis
int XPRDsetdefstream(XPRSmodel mosel, XPRDmodel model, int wmd, const char *filename);
Arguments
mosel 
Reference to a Mosel instance or NULL
model 
Reference to a model or NULL
wmd 
Stream to set. Possible values:
XPRD_F_READ 
Default input stream
XPRD_F_WRITE 
Default output stream
XPRD_F_ERROR 
Default error stream
XPRD_F_LINBUF 
Use line buffering
filename 
Extended file name to be used for the stream.
Return value
0 if successful, 1 otherwise.
Further information
1. This function sets the default I/O streams to be used by a model (if model is provided) or by the entire instance (if mosel is provided). Model streams can be changed only when the model is not running. Each stream is associated with an extended file name ( i.e. I/O drivers can be used). For output streams, XPRD_F_LINBUF may be specified ( e.g. XPRD_F_WRITE+XPRD_F_LINBUF) in order to enable line buffering for the corresponding stream (the error stream is always open using line buffering).
2. For input and output streams, the filename is stored and streams are actually opened when execution of the model starts: in case of an invalid file name, the error is not reported by this function. The error stream is immediately opened so the case of an invalid file name is reported by this function. If the first parameter is NULL, this function defines the corresponding global stream: it is used as the default when a model is loaded and whenever no model information is available ( e.g. compilation errors, error on modules, etc.). This option can be used only if no model is currently loaded in memory.
3. Using an empty string as the file name implies resetting to the original default stream: "null" for input; "rmt:sysfd:1" for output and "rmt:sysfd:2 for error.