littlefs
littlefs copied to clipboard
esp_littlefs: Failed to unlink path "/flash/index.html". Has open FD.
Hello,
I'm working on native ESP-IDF 4.4 .4 with a ESP32 I try to delete a file which was opened before but correctly closed,
I got the error: esp_littlefs: Failed to unlink path "/flash/index.html". Has open FD.
I tried straight forward:
f = fopen(file_name, "rb");
fclose(f);
unlink(file_name); // erase if exists
Does not help, only a unregister, re-register works, but that is not a solution same code works with SPIFFS
any hints ?
Regards, Mike
Hi @grooves38, this looks like an issue in the ESP-IDF layer. The littlefs core (this repo) doesn't actually care if a file is open in unlink.
You will probably need to open an issue in ESP-IDF to find someone who knows what the issue might be. The fact that SPIFFS works is curious, but it could be a different in the integration for the two filesystem there. They do need to support what is probably subtly different filesystem APIs.