Seeks to an arbitrary position in Stream.
A valid Prolog stream.
The offset, in items, to seek relative to the specified Method.
Items are bytes for binary streams, characters for text streams.
[bof,current,eof], must be nonvar
Where start seeking, one of the following:
The offset from beginning of the file after seeking operation.
Sets the current position of the file stream Stream to a new position according to Offset and Method. If Method is:
Avoid using this Method. Determining the size of the stream may be expensive or unsupported for some streams.
Positions and offsets are measured in items, bytes for binary streams and characters for text streams. Note that there may not be any simple relationship between the number of characters read and the byte offset of a text file.
After applying this operation on a text stream, the line counts and line position aspects of the stream position of Stream will be undefined.
The term “file” above is used even though the stream may be connected to other seekable objects that are not files, e.g. an in-memory buffer.
Stream errors (see ref-iou-sfh-est), plus:
eof, or the resulting position would refer to an unsupported location. Some streams supports setting the position past the current end of the stream, in this case the stream is padded with zero bytes or characters as soon as an item is written to the new location.
reposition(true), the stream is a text stream that does not implement seeking, or an I/O error happened during seek.