[ Stream I/O | Reference Manual | Alphabetic Index ]
current_stream(?Stream)
Succeeds if Stream is a currently open stream.
- Stream
- Atom, integer or variable.
Description
   Used to test whether a given identifier denotes an open stream,
   or enumerates all currently open streams on backtracking.
   When called with a variable argument, only the physical stream
   numbers are returned, not the symbolic aliases.
Modes and Determinism
- current_stream(+) is semidet
- current_stream(-) is nondet
Fail Conditions
Fails if Stream is instantiated but does not denote an open stream.
Exceptions
- (5) type error 
- Name is instantiated, but not to an atom or integer.
Examples
Success:
    [eclipse 1]: current_stream(S).
    S = 0     More? (;) 
    S = 1     More? (;) 
    S = 2     More? (;) 
    S = 3     More? (;) 
    S = 4     More? (;) 
    S = 5     More? (;) 
    no (more) solution.
    [eclipse 2]: current_stream(output).
    yes.
    [eclipse 3]: current_stream(junk).
    no (more) solution.
See Also
open / 3, open / 4, get_stream_info / 3, get_stream / 2