seek/4
seek(
+Stream, +Offset, +Method, -NewLocation)
Seeks to an arbitrary byte position in Stream.
[bof,current,eof]
bof
current
eof
Sets the current position of the file stream Stream to a new position according to Offset and Method. If Method is
bof
current
eof
If Offset is 0, seek/4
returns the current position from
the beginning of Stream and sets the position to the same
location.
If Stream is an output stream permitting flushing output, the characters in the buffer of the stream are flushed before seek is performed. If the output stream Stream does not permit flushing output and there are characters remaining in the buffer, then a permission error is raised.
If Stream is an input stream, the characters in the input
buffer of the stream are discarded before seek is performed. The
input buffer is empty when the seek/4
call returns.
Stream errors (see ref-iou-sfh-est), plus:
domain_error
bof
, current
or eof
.
Offset is a negative value and
Method is bof
.
Offset is a positive value and Method is eof
.
instantiation_error
type_error
Offset is not an integer type.
Method is not an atom type.
permission_error
seek(byte)
permission.
An error occurred while seeking in the file stream.
Flushing attempted but not permitted.
stream_position/[2,3]
, open/4
, character_count/2
, line_count/2
, line_position/2
.
ref-iou