Next: , Previous: Programmatic ports, Up: I/O system


4.5.3 Miscellaneous I/O internals

All of these but port-status-options are exported by the i/o-internal structure; the port-status-options enumeration is exported by the architecture structure, but it deserves mention in this section.

— enumeration: port-status-options
          (define-enumeration port-status-options
            (input
             output
             open-for-input
             open-for-output))

Enumeration of indices into a port's status field bit set.

— procedure: open-input-port? port –> boolean
— procedure: open-output-port? port –> boolean

These return true values if port is both an input or output port, respectively, and open.

— constant: open-input-port-status –> integer-status
— constant: open-output-port-status –> integer-status

The bitwise masks of enumerands from the port-status-options enumeration signifying an open input or output port, respectively.

— procedure: make-input-port-closed! port –> unspecified
— procedure: make-output-port-closed! port –> unspecified

These set the status of port, which must be an input or output port, respectively, to indicate that it is closed.

— procedure: eof-object –> eof-object

Returns the EOF object token. This is the only value that will answer true to R5RS's eof-object? predicate.

— procedure: force-output-if-open port –> unspecified

This forces port's output if it is an open output port, and does not block.

— procedure: periodically-force-output! port –> unspecified
— procedure: periodically-flushed-ports –> port-list

Periodically-force-output! registers port to be forced periodically. Only a weak reference to port in this registry is held, however, so this cannot cause accidental space leaks. Periodically-flushed-ports returns a list of all ports in this registry. Note that the returned list holds strong references to all of its elements. Periodically-flushed-ports does not permit thread context switches, or interrupts of any sort, while it runs.