littlefs icon indicating copy to clipboard operation
littlefs copied to clipboard

esp_littlefs: Failed to unlink path "/flash/index.html". Has open FD.

Open grooves38 opened this issue 1 year ago • 1 comments

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

grooves38 avatar Jan 03 '24 16:01 grooves38

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.

geky avatar Jan 16 '24 06:01 geky