11.3.216 stream_position/2

Synopsis

stream_position(+Stream, -Position)

True when Position represents the current position of Stream.

Arguments

Stream
stream_object, must be ground

An open stream.

Position
term

Stream position object representing the current position of Stream.

Description

Byte, character, and line counts and line position determine the position of the pointer in the stream. Such information is found by using byte_count/2, character_count/2, line_count/2 and line_position/2. A stream position object packages this information as a single Prolog terms. You can retrieve this information from a stream position object using stream_position_data/3. Do not rely on the form of this object in any other way.

Standard term comparison of two stream position objects for the same stream will work as one expects. When SP1 and SP2 refer to positions in the same stream, SP1 @< SP2 if and only if SP1 is before SP2 in the stream.

Exceptions

Stream errors (see ref-iou-sfh-est).

Examples

See Also

ref-iou-sfh.


Send feedback on this subject.