File.error

bool error() @property const @trusted pure nothrow

If the file is closed or not yet opened, returns true. Otherwise, returns ferror for the file handle.