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 initial standard output and error ports are
automatically flushed when read, read-line, read-string,
or read-string! are performed
on the initial 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. The file-position
procedure can return the current position for any import or
export port, but calling file-position with a position and a
non-file port raises the exn:application-file-position
exception.
PLT