Node:Streams, Next:, Previous:Operators, Up:Top



Streams

A stream is a sequence of values combined with a current position. You can read (or write) only the sequence element at teh current position; however, the position is changed by various stream options described below.

Reading characters in from files or writing characters out to files uses character streams. These are often called files.

stream get Function
Get the next value from the stream, moving the current position forward. At end of file, return ???.

stream peek Function
[NOT IMPLEMENTED?] Same as get, not does not change the current position.

stream get n Function
Get the next n values from the stream, returning a list of the n values read. If the there are less than n characters after the current position, just return as many as are available. (That is, if the stream was at end of file, return an empty array.) Move the current position forward as many characters as were read.

stream put value Function
Write value to the stream; that is, set the current element to value and move the current position forward. Returns the null sequence.

stream put value1 ... valuen Function
Same as:
(stream put value1; ...; stream put valuen)

stream seek pos Function
Move the current position of the stream to the position pos, an integer offset relative to the beginning of the stream.

stream relseek pos Function
Move the current position of the stream to the integer offset pos relative to the current position of the stream.

stream endseek pos Function
Move the current position of the stream to the integer offset pos relative to the end of the stream.