This built-in predicate identifies the current output stream. If Stream is a variable or a stream term, if the current output stream unifies with Stream then current_output/1 succeeds else it fails.
see also: at_end_of_stream/0 at_end_of_stream/1 close/1 close/2 close_user_streams/0 current_input/1 flush_output/0 flush_output/1 open/3 open/4 prolog I/O set_input/1 set_output/1 set_stream_position/2 set_stream_property/2 stream_property/2
| Example | |
| current_output(Name). | Name is unified with the term $atom(2), which is the unique identifier of the standard output stream, this term is an implementation dependent |
| Exceptions | |
| stream is neither a variable nor a stream term nor an alias | a domain_error(stream, Stream) exception is thrown, the variable Stream is assigned the incorrect stream_or_alias term |