
flush(+Stream)

   Flushes the output stream Stream.  

Arguments
   Stream              Stream handle or alias (atom)

Type
   Stream I/O

Description

   Used to flush any data contained in the Stream buffer of an output stream.
   Flushing means that the data is transferred from a memory buffer to the
   operation system's I/O system.

   Buffers are normally only flushed when they get full, or when the stream
   is closed.  Explicit flushing in between reduces performance, but sometimes
   it is desirable to make sure that data is actually written at certain points.

   Note that streams can be also be configured to flush automatically at
   every newline, using the flush(end_of_line) option.

   Stream can be a symbolic stream name (atom) or a stream handle.



Modes and Determinism
   flush(+) is det

Exceptions
     4 --- Stream is not instantiated.
     5 --- Stream is instantiated neither to a stream handle nor an atom.
   192 --- Stream is not an output stream.

Examples
   
Success:
      flush(output).
      flush(null).


Error:
      flush(Stream).            (Error 4).
      flush("Stream").          (Error 5).
      flush(12).                (Error 192). % no such stream
      flush(debug_input).       (Error 192). % input stream


See Also
   set_stream_property / 3, open / 3, open / 4, close / 1, tyo / 2
