File I/O error information
message = ferror(fileID)
[message,errnum] = ferror(fileID)
[message,errnum] = ferror(fileID,'clear')
fileID— File identifier
File identifier of an open file, specified as an integer.
fileID can be one of these values:
N — Input or output from a file with a
valid file identifier generated by the
N is equal to or greater than
0 — Input from a standard input
1 — Output to a standard output
2 — Standard error.
message— Error message
Error message, returned as character vector containing the error message
associated with the most recent I/O operation. If the most recent I/O
operation is successful or if you clear it manually, then
message is an empty character vector.
errnum— Error number
Error number, returned as an integer code associated with the error from
most recent file I/O operation. If the most recent file I/O operation is
errnum indicates an error:
Negative values correspond to MATLAB® error messages.
Positive values correspond to C library error messages for your system.