Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File loss due to program interruption before file closing #575

Open
HamzaHajeir opened this issue Jun 24, 2021 · 0 comments
Open

File loss due to program interruption before file closing #575

HamzaHajeir opened this issue Jun 24, 2021 · 0 comments

Comments

@HamzaHajeir
Copy link

Hi there

Thanks for the great library!

I've noticed a file loss if the program is interrupted at small time windows, where the file is opened, but not yet committed (via sync).

esp8266/Arduino#8155 is an example of file loss.

The fail comes due to erasing the file when opened in writing mode.

As mentioned in docs 'recover guarantee to the last well-known state of the file', I'm looking for solution for such loss, so:

  1. Does it erases the file when opened with LFS_O_RDWR flag?
  2. If it's erased in LFS_O_RDWR, Is there an available mechanism to do so?
  3. If there's no available mechanism, could be there a new flag indicates to preserve the file content until the lfs_file_close call?

Potential similar issue:

#344

Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant