stream-flush ( stream -- )
Factor documentation > Factor handbook > Input and output > Streams > Stream protocol
Prev:stream-readln ( stream -- str/f )
Next:stream-write1 ( elt stream -- )


Vocabulary
io

Inputs and outputs
streaman output stream


Generic word contract
Waits for any pending output to complete.

Notes
With many output streams, written output is buffered and not sent to the underlying resource until either the buffer is full, or this word is called.

Notes
Most code only works on one stream at a time and should instead use flush; see Default input and output streams.

Errors
Throws an error if the I/O operation fails.

Definition
IN: io

GENERIC: stream-flush ( stream -- )


Methods
USING: accessors io io.streams.256color.private ;

M: 256color stream-flush stream>> stream-flush ;


USING: accessors destructors io io.streams.c kernel ;

M: c-writer stream-flush dup check-disposed handle>> fflush ;


USING: curses curses.listener io kernel ;

M: curses-listener-stream stream-flush drop crefresh ;


USING: accessors io io.streams.duplex kernel ;

M: duplex-stream stream-flush
[ out>> ] call \ stream-flush execute ;


USING: accessors io io.encodings ;

M: encoder stream-flush stream>> stream-flush ; inline


USING: io kernel ;

M: f stream-flush drop ; inline


USING: accessors io io.styles kernel ;

M: filter-writer stream-flush
[ stream>> ] call \ stream-flush execute ;


USING: growable io kernel ;

M: growable stream-flush drop ;


USING: html.streams io kernel ;

M: html-writer stream-flush drop ;


USING: io io.streams.null kernel ;

M: null-writer stream-flush drop ;


USING: destructors io io.ports kernel ;

M: output-port stream-flush
[ check-disposed ] [ port-flush ] bi ;


USING: io kernel ;

M: output-stream stream-flush drop ; inline


USING: io kernel ui.gadgets.panes ;

M: pane-stream stream-flush drop ;


USING: io kernel pdf.streams ;

M: pdf-writer stream-flush drop ;


USING: accessors io io.streams.peek ;

M: peek-stream stream-flush stream>> stream-flush ;