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

unable to remove a file when it's open? #22

Closed
proddy opened this issue Mar 4, 2021 · 3 comments
Closed

unable to remove a file when it's open? #22

proddy opened this issue Mar 4, 2021 · 3 comments

Comments

@proddy
Copy link

proddy commented Mar 4, 2021

With SPIFFS this was valid:

  File root = fs->open("/configdir");
  File file;
  while (file = root.openNextFile()) {
    fs->remove(file.name());
  }

but with LITTLEFS it will throw an error esp_littlefs: Failed to unlink path "/configdir/file.json". Has open FD.

it's easy to circumvent by cloning the path and issuing a file.close() before the remove() but was I just curious whether this is by design?

@lorol
Copy link
Owner

lorol commented Mar 4, 2021

Yes, it is different. @BrianPugh may elaborate more details on the lower level.

@lorol
Copy link
Owner

lorol commented Mar 5, 2021

@proddy, see this issue on same subject - it was already discussed.
#7 (comment)
Hope that helps you to find an acceptable solution

@proddy
Copy link
Author

proddy commented Mar 5, 2021

ah thanks. I should have browsed the closed issues. It's not a problem, but people using Arduino and thinking they can swap out SPIFFS with LITTLEFS will likely encounter the same issue. Perhaps worth documenting it somewhere. Anyway thanks for following up and great work on the port!

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

2 participants