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.
Example
fileerror();
output("file.txt", "wt") {
printf("Test\n");
}
if (fileerror())
exit(1);
| Index | Copyright © 2005 CadSoft Computer GmbH |