Guile Reference Manual
Special treatment is required for ports which can be seeked at random.
Before various operations, such as seeking the port or changing from
input to output on a bidirectional port or vice versa, the port
implementation must be given a chance to update its state. The write
buffer is updated by calling the
flush ptob procedure and the
input buffer is updated by calling the
end_input ptob procedure.
In the case of an fport,
flush causes buffered output to be
written to the file descriptor, while
end_input causes the
descriptor position to be adjusted to account for buffered input which
was never read.
The special treatment must be performed if the
rw_random flag in
the port is non-zero.