The file module has functions get and clear a file’s error status that are almost exact equivalents to POSIX API functions; the primary difference is the advantage of valuable return error codes to the application.
For more information about this functionality, see section 10-3-4 “Diagnosing Diagnosing a File Error”Error.