Method _Stdio.Buffer()->read_cstring()


Method read_cstring

string(8bit) read_cstring(void|int(8bit) sentinel, void|int(8bit) escape)

Description

Reads a \0 terminated C-string and returns the string excluding the terminating \0.

If there is not enough data available return UNDEFINED.

Note that pike string can not be longer than 0x7fffffff bytes (~2Gb).

Parameter sentinel

A different character can be used as end sentinel of the string.

Parameter escape

An optional character used as a prefix to quote the following character. UNDEFINED and the same value as sentinel mean that there is no escape character.

Note

Escape characters (if any) are left untouched in the returned string.

See also

_search()