with-output-stream ( stream quot -- )
Factor documentation > Factor handbook > Input and output > Streams > Default input and output streams
Prev:seek-output ( n seek-type -- )
Next:with-output-stream* ( stream quot -- )


Vocabulary
io

Inputs and outputs
streaman output stream
quota quotation


Word description
Calls the quotation in a new dynamic scope, with output-stream rebound to stream. The stream is closed if the quotation returns or throws an error.

See also
with-output-stream*

Definition
USING: destructors kernel ;

IN: io

: with-output-stream ( stream quot -- )
[ with-output-stream* ] curry with-disposal ; inline