with-output-stream* ( stream quot -- )
Factor handbook > Input and output > Streams > Default input and output streams

Prev:with-output-stream ( stream quot -- )
Next:with-streams ( input output 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.

Examples
USING: destructors io io.encodings.utf8 io.files prettyprint ; "/tmp/test.txt" utf8 <file-writer> dup [ "Hello!" write ] with-output-stream* dispose "/tmp/test.txt" utf8 file-contents .
"Hello!"


Notes
This word does not close the stream. Compare with with-output-stream.

See also
with-output-stream

Definition