FERROR
NAME
clearerr, feof, ferror, fileno - check and reset stream status
SYNOPSIS
#include <stdio.h>
I void clearerr(FILE * stream );
I int feof(FILE * stream );
I int ferror(FILE * stream );
I int fileno(FILE * stream );
DESCRIPTION
The function
R clearerr ()
clears the end-of-file and error indicators for the stream pointed to by
R stream .
The function
R feof ()
tests the end-of-file indicator for the stream pointed to by
R stream ,
returning non-zero if it is set.
The end-of-file indicator can only be
cleared by the function
R clearerr ().
The function
R ferror ()
tests the error indicator for the stream pointed to by
R stream ,
returning non-zero if it is set.
The error indicator can only be reset by the
R clearerr ()
function.
The function
R fileno ()
examines the argument
stream
and returns its integer descriptor.
ERRORS
These functions should not fail and do not set the external variable
R errno .
(However, in case
R fileno ()
detects that its argument is not a valid stream, it must
return -1 and set
errno
to
R EBADF .)
CONFORMING TO
The functions
R clearerr (),
R feof (),
and
R ferror ()
conform to C89 and C99.
SEE ALSO