fcheckerr¶
Purpose¶
Gets the error status of a file.
Format¶
Examples¶
// Create a file name with full path
fname = getGAUSSHome() $+ "startup";
// Open a file handle for
// reading only from the file
fh = fopen(fname, "r");
// Try to write to the file using a read-only file handle
ret = fputs(fh, "alpha,beta,gamma");
// Check to see if there was a file i/o error
if fcheckerr(fh);
print "File write failed";
endif;
call close(fh);
After the above code, the program will print:
File write failed
Remarks¶
If you pass fcheckerr()
the handle of a file opened with open (i.e., a
dataset or matrix file), your program will terminate with a fatal error.