Extracted from Pike v7.3 release 14 at 2002-02-15.
pike.roxen.com
[Top]
Stdio
Stdio.Fd

Method Stdio.Fd()->peek()


Method peek

int(-1..1) Stdio.Fd()->peek()
int(-1..1) Stdio.Fd()->peek(int|float timeout)

Description

Check if there is data available to read, or wait some time for available data to read.

Returns 1 if there is data available to read, 0 (zero) if there is no data available, and -1 if something went wrong.

See also

Stdio.Fd.errno, Stdio.Fd.read

Note

The function may be interrupted prematurely of the timeout (due to signals); check the timing manually if this is imporant.