11.3.28 byte_count/2

Synopsis

byte_count(+Stream, -Count)

Obtains the total number of bytes either input from or output to the open binary stream Stream and unifies it with Count.

Arguments

Stream
stream_object, must be ground

A valid open binary stream.

Count
integer

The resulting byte count of the stream.

Description

A freshly opened stream has a byte count of 0. When a byte is input from or output to a Prolog stream, the byte count of the Prolog stream is increased by one.

The count is reset by set_stream_position/2.

Exceptions

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

See Also

byte_count/2, line_count/2, line_position/2, stream_position/2, set_stream_position/2, ref-iou-sfh.


Send feedback on this subject.