setdefstream
setdefstream |
Purpose
Synopsis
procedure setdefstream(mo:Model, wmd:integer, fname:string)
procedure setdefstream(mo:Model, input:string, output:string, error:string)
procedure setdefstream(mi:Mosel, wmd:integer, fname:string)
procedure setdefstream(mi:Mosel, input:string, output:string, error:string)
Arguments
mo
|
A Model
|
||||||||
mi
|
A Mosel instance
|
||||||||
wmd
|
Stream to set. Possible values:
|
||||||||
fname
|
Extended file name to be used for the stream.
|
||||||||
input
|
Extended file name to be used for the input stream.
|
||||||||
output
|
Extended file name to be used for the output stream.
|
||||||||
error
|
Extended file name to be used for the error stream.
|
Further information
1. This function sets default IO streams to be used by a model. Model streams can be changed only when the model is not running. Each stream is associated to an extended file name (
i.e. IO drivers can be used). For output streams,
F_LINBUF may be specified (
e.g.
F_WRITE+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 open 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 in the case of an invalid file name it is detected by this function.
3. Using an empty string as the file name implies resetting to the original default stream.
4. When applied to a Mosel instance, this routine sets the default streams for this instance. These streams can only be changed if the instance has not yet loaded any model.
5. When using this routine on a separate Mosel instance or on a model loaded on a separate Mosel instance, it is important to keep in mind that the operation is performed in the environment of this instance (in particular its current working directory) and file names should be specified appropriately (the
rmt: IO driver can be particularly helpful in this context).
Module