Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The file module has functions get and clear a file’s error status that are almost exact equivalents to POSIX API functions (see Listing - File Module Function and Listing - POSIX API Equivalent); the primary difference is the advantage of valuable return error codes to the application.


Code Block
languagecpp
titleListing - File Module Function
linenumberstrue
void         FSFile_ClrErr(FS_FILE *p_file,
                           FS_ERR  *p_err);
CPU_BOOLEAN  FSFile_IsErr (FS_FILE *p_file,
                           FS_ERR  *p_err);
CPU_BOOLEAN  FSFile_IsEOF (FS_FILE *p_file,
                           FS_ERR  *p_err);




Code Block
languagecpp
titleListing - POSIX API Equivalent
linenumberstrue
void fs_clearerr (FS_FILE *stream);

int  fs_ferror   (FS_FILE *stream);

int  fs_feof     (FS_FILE *stream);



For more information about this functionality, see Diagnosing a File Error - POSIX.