13.1.2 Managing Ports (original) (raw)

13.1.2 Managing Ports🔗

Returns #t if v is an input port, #f otherwise.

Returns #t if v is an output port, #f otherwise.

Returns #t if either (input-port? v) or(output-port? v) is #t, #f otherwise.

Closes the input port in. For some kinds of ports, closing the port releases lower-level resources, such as a file handle. If the port is already closed, close-input-port has no effect.

Closes the output port out. For some kinds of ports, closing the port releases lower-level resources, such as a file handle. Also, if the port is buffered, closing may first flush the port before closing it, and this flushing process can block. If the port is already closed, close-output-port has no effect.

Returns #t if the input or output port port is closed, #f otherwise.

A parameter that determines a default input port for many operations, such asread.

A parameter that determines a default output port for many operations, such aswrite.

A parameter that determines an output port that is typically used for errors and logging. For example, the default error display handler writes to this port.

Changed in version 7.2.0.5 of package base: Extended file-stream-port?to any value, instead of resticting the domain to ports

Returns #t if v is a port that is attached to an interactive terminal, #f otherwise.

Changed in version 7.2.0.5 of package base: Extended terminal-port?to any value, instead of resticting the domain to ports

Returns #t if port is not ready for reading or writing because it is waiting for a peer process to complete a stream construction, #f otherwise.

On Unix and Mac OS, opening a fifo for output creates a peer-waiting port if no reader for the same fifo is already opened. In that case, the output port is not ready for writing until a reader is opened; that is, write opertaions will block. Use sync if necessary to wait until writing will not block—that is, until the read end of the fifo is opened.

Added in version 7.4.0.5 of package base.

A value (distinct from all other values) that represents an end-of-file.

Returns #t ifv is eof, #f otherwise.