Preserve File error state once error occurs.

This commit is contained in:
Jared Boone
2016-05-12 21:54:13 -07:00
parent 0f1ae96ba4
commit b21758781c
2 changed files with 35 additions and 11 deletions

View File

@@ -126,7 +126,7 @@ public:
~File();
bool is_open() const {
return f_error(&f) == 0;
return err == FR_OK;
}
bool read(void* const data, const size_t bytes_to_read);
@@ -145,6 +145,7 @@ public:
private:
FIL f;
uint32_t err;
};
inline constexpr File::openmode operator|(File::openmode a, File::openmode b) {