HomeManualTopicsTypesSymbols

std::read_from_until

reads data from the specified input channel until a specific sentinel is encountered

Parameters

fd
the input channel
sentinel
the sentinel to look for
nth (default: 1)

Results

None

Description

The sentinel must consist of octets.

If nth is given then the sentinel must occur exactly nth times.

Sentinels should not overlap!

The function might block until the input channel is ready to deliver more data.

The read data is treated as binary bytes.

The sentinel is included in the returned octet string.

This function needs I/O-access rights.

Example

read_from_until! $data fd STDIN_FILENO '@nl;'

Topic

Input-Output

See also

std::readln_from reads a line from the specified input channel
std::read_from reads data from the specified input channel