[Top]
predef::
Stdio
Stdio.File
|
Method Stdio.File()->peek()
- Method
peek
-
int(-1..1) peek()
int(-1..1) 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
-
errno() , read()
- Note
-
The function may be interrupted prematurely
of the timeout (due to signals);
check the timing manually if this is imporant.
|