11.3.204 set_stream_position/2 [ISO]

Synopsis

set_stream_position(+Stream, +Position)

Sets the current position of Stream to Position.

Arguments

Stream
stream_object, must be ground

An open stream.

Position
term

Stream position object representing the current position of Stream.

Description

set_stream_position/2 repositions the stream pointer, and also the other counts, such as byte, character, and line counts and line position. It may only be used on streams that have been opened with the open/4 option reposition(true).

Please note: A stream position object is represented by a special Prolog term. The only safe way of obtaining such an object is via stream_position/2 or stream_property/2. You should not try to construct, change, or rely on the form of this object. It may change in subsequent releases.

Exceptions

Stream errors (see ref-iou-sfh-est), plus:

instantiation_error
domain_error
Position is not a valid stream position object.

See Also

stream_position/2, stream_property/2, ref-iou-sfh.


Send feedback on this subject.