ferror

Query the MATLAB® software about errors in file input or output

Syntax

message = ferror(fid)
message = ferror(fid, 'clear')
[message,errnum] = ferror(...)

Description

message = ferror(fid) returns the error string message. Argument fid is a file identifier associated with an open file (see fopen for a complete description of fid).

message = ferror(fid, 'clear') clears the error indicator for the specified file.

[message,errnum] = ferror(...) returns the error status number errnum of the most recent file I/O operation associated with the specified file.

If the most recent I/O operation performed on the specified file was successful, the value of message is empty and ferror returns an errnum value of 0.

A nonzero errnum indicates that an error occurred in the most recent file I/O operation. The value of message is a string that can contain information about the nature of the error. If the message is not helpful, consult the C run-time library manual for your host operating system for further details.

See Also

fclose, fopen, fprintf, fread, fscanf, fseek, ftell, fwrite

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS