Chapter Contents

Previous

Next
clrerr

clrerr



Clear Error Flag and Return Status

Portability: SAS/C extension


SYNOPSIS
DESCRIPTION
RETURN VALUE
EXAMPLE
RELATED FUNCTIONS
SEE ALSO


SYNOPSIS

#include <stdio.h>

int clrerr(FILE *f);


DESCRIPTION

clrerr clears the error flag and end-of-file flag for the FILE object addressed by f .


RETURN VALUE

clrerr returns 0 if the error flag has been cleared or EOF if it could not be cleared. (The flag is not cleared if the operating system does not permit further use of the file or if the file is closed.)


EXAMPLE

#include <lcio.h>

   /* Clear the error flag for a file. */
int fixerr(FILE *f)
{
      /* Show error flag cleared.      */
   if (clrerr(f) != 0){
      printf("Error on %s is permanent. Program aborted.\n", fnm(f));
      abort();
   }
return 0;
}


RELATED FUNCTIONS

clearerr , ferror


SEE ALSO


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.