(Formerly known as FileIsError, which is now obsolete)
readonly bool File.Error
Checks whether an error has occurred reading from or writing to the specified file.
An error can occur if, for example, you run out of disk space or the user removes the
disk that is being read from.
This function only checks for errors while actually reading/writing data. The File.Open
function will return null if there was an error actually opening or creating the file.
To find out whether all data has been read from a file, use EOF instead.
Example:
File *output = File.Open("test.dat", eFileWrite);
output.WriteInt(51);
if (output.Error) {
Display("Error writing the data!");
}
output.Close();
will write a number to the file 'test.dat', and display a message if there was a problem.
See Also: File.EOF, File.ReadStringBack
|