EAGLE Help

fileerror()


Function
Returns the status of I/O operations.

Syntax
int fileerror();

Returns
The fileerror function returns 0 if everything is ok.

Description
fileerror checks the status of any I/O operations that have been performed since the last call to this function and returns 0 if everything was ok. If any of the I/O operations has caused an error, a value other than 0 will be returned.

You should call fileerror before any I/O operations to reset any previous error state, and call it again after the I/O operations to see if they were successful.

When fileerror returns a value other than 0 (thus indicating an error) a proper error message has already been given to the user.

See also output, printf, fileread

Example

fileerror();
output("file.txt", "wt") {
  printf("Test\n");
  }
if (fileerror())
   exit(1);

Index Copyright © 2005 CadSoft Computer GmbH