rust-fatfs
rust-fatfs copied to clipboard
Allow clearing FAT dirty flag.
When the FAT dirty flag is set (which happens after ejecting an SD card without unmounting first on macOS), creating directories does not work as expected afterwards: When remounting the SD card after creating directories, these directories will be files instead.
If the dirty flag is cleared before creating the directories, mounting the SD card again under macOS works as expected, i.e. the directories are accessible as normal.
I have added a set_fat_dirty_flag
method to clear the flag, but I am not sure when clearing this flag should be done.
When the dirty flag is set, this should result in an error when creating the FileSystem
(or when trying to write to it).
Alternatively, the flag should ideally be cleared automatically when mounting after the filesystem has been checked somehow.
Closes https://github.com/rafalh/rust-fatfs/issues/64.
@rafalh, I have moved the check and added an option to ignore/clear the flag when mounting the file system.
@rafalh, can you review this again? Thanks.
@rafalh, ping.
@rafalh, could you have another look here? Thanks.
@rafalh, can you take a look here? You should review my other PRs first so I can rebase this one for easier review.