The Stream function returns the state of, or result of an operation upon, a character stream.
The Stream function is implementation-dependent. This function was not defined prior to Language Level 4.00. Consequently, some Rexx environments may not support the Stream function.
|result = Stream( name, [, operation [, command ] ] )|
The operation is one of the following:
Command -- the command argument identifies a stream operation to perform
Description -- an implementation-dependent description of the stream's status
State -- the current status of the stream (Default value of operation argument)
The possible states of a stream are:
ERROR -- the stream is inaccessible
NOTREADY -- the stream does not have characters available
READY -- the stream has characters available
UNKNOWN -- the stream is not being accessed
When the operation argument is absent, the stream state is returned.
say Stream( 'file1', 'S' ) -- shows: ERROR, NOTREADY, READY, or UNKNOWN
say Stream( 'file1' ) -- shows: ERROR, NOTREADY, READY, or UNKNOWN
call Stream 'file1', 'C', 'Close' -- closes the stream (implementation-dependent)