Handbook
Glossary
Stream utilities
Factor handbook
»
Input and output
»
Streams
Prev:
Default input and output streams
There are a few useful stream-related words which are not generic, but merely built up from the stream protocol.
First, a simple composition of
stream-write
and
stream-nl
:
stream-print
( str stream -- )
Processing lines one by one:
stream-lines
( stream -- seq )
read-lines
( -- seq )
each-line
( ... quot: ( ... line -- ... ) -- ... )
Processing blocks of data:
stream-contents
( stream -- seq )
read-contents
( -- seq )
each-block
( ... quot: ( ... block -- ... ) -- ... )
Copying the contents of one stream to another:
stream-copy*
( in out -- )
stream-copy
( in out -- )