CLCS

Input, Output, and Bidirectional Streams

A stream, whether a character stream or a binary stream, can be an input stream (source of data), an output stream (sink for data), both, or (e.g., when ":direction :probe" is given to open) neither.

Figure 21–2 shows operators relating to input streams.

clear-inputread-byteread-from-string
listenread-charread-line
peek-charread-char-no-hangread-preserving-whitespace
readread-delimited-listunread-char
Figure 21–2: Operators relating to Input Streams.

Figure 21–3 shows operators relating to output streams.

clear-outputprin1write
finish-outputprin1-to-stringwrite-byte
force-outputprincwrite-char
formatprinc-to-stringwrite-line
fresh-lineprintwrite-string
pprintterpriwrite-to-string
  Figure 21–3: Operators relating to Output Streams.

A stream that is both an input stream and an output stream is called a bidirectional stream . See the functions input-stream-p and output-stream-p.

Any of the operators listed in Figure~21–2 or Figure~21–3 can be used with bidirectional streams. In addition, Figure 21–4 shows a list of operators that relate specificaly to bidirectional streams.

y-or-n-pyes-or-no-p
Figure 21–4: Operators relating to Bidirectional Streams.