Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/c/clearerr.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/c/clearerr.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/c/clearerr.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/c/clearerr.html on line 8

clearerr()

Clear a stream's end-of-file and error flags

Synopsis:

#include <stdio.h>

void clearerr( FILE *fp );

Arguments:

fp
The stream for which you want to clear the flags.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The clearerr() function clears the end-of-file and error flags for the stream specified by fp.

These indicators are also cleared when the file is opened, or by an explicit call to clearerr() or rewind().

Examples:

#include <stdio.h>
#include <stdlib.h>

int main( void )
{
    FILE *fp;
    int c;

    c = 'J';
    fp = fopen( "file", "w" );
    if( fp != NULL ) {
      fputc( c, fp );
      if( ferror( fp ) ) {  /* if error        */
          clearerr( fp );   /* clear the error */
          fputc( c, fp );   /* and retry it    */
      }
    }

    fclose( fp );

    return EXIT_SUCCESS;
}

Classification:

ANSI, POSIX 1003.1

Safety:
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes

See also:

feof(), ferror(), fopen(), perror(), rewind()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/c/clearerr.html on line 140

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/c/clearerr.html on line 140