Next Previous Up Top Contents Index

5.6 Reading from and writing to streams

5.6.5 Querying streams

The following functions can be used to determine various properties of a stream.

stream-open?

Open generic function

stream-open? stream => open? 

Returns #f if the stream has been closed, and #t otherwise. Note that an input stream which is at its end, but has not been closed, is still open and stream-open? will return #t.
stream-element-type

Open generic function

stream-element-type stream => element-type 

Returns the element type of stream as a Dylan <type>.
stream-at-end?

Open generic function

stream-at-end? stream => boolean 

Returns #t if the stream is at its end and #f if it is not. For input streams, it returns #t if a call to read-element with no supplied keyword arguments would signal an <end-of-stream-error>. For output streams, this function always returns #f.
For output streams, note that you can determine if a stream is one place past the last written element by comparing stream-position to stream-size.

System and I/O Reference - 31 MAR 2000

Next Previous Up Top Contents Index