Computation
hSeek hdl mode i sets the position of
handle
hdl depending on
mode. The offset
i
is given in terms of 8-bit bytes.
If
hdl is block- or line-buffered, then seeking to a position
which is not in the current buffer will first cause any items in the
output buffer to be written to the device, and then cause the input
buffer to be discarded. Some handles may not be seekable (see
hIsSeekable), or only support a subset of the possible
positioning operations (for instance, it may only be possible to seek
to the end of a tape, or to a positive offset from the beginning or
current position). It is not possible to set a negative I/O position,
or for a physical file, an I/O position beyond the current
end-of-file.
This operation may fail with: