
Next: Custom Ports
Up: Ports
Previous: String Ports
Two special procedures work on file ports:
- (flush-output port)
forces all buffered data in the given file output
port to be physically written. Buffered data is
automatically flushed after each newline. The standard output and
error ports are automatically flushed before a character is read from
the standard input port. When called on a non-file port,
flush-output takes no action. If port is omitted, then
the current output port is flushed.
- (file-position port)
returns the current read/write position of the
file port port, and (file-position port pos)
sets the read/write position to pos. Calling file-position
without a position on a non-file input port returns the number of
characters that have been read from that port. It is an error to call
file-position on a non-file output port, or to call
file-position with a position on a non-file input port.
(The exn:application:type exception is raised in these cases.)
PLT