-->
Page 1 of 2

SPIFFS.remove leaves 0 length file

PostPosted: Tue Apr 11, 2017 1:30 pm
by btidey
I am using SPIFFS successfully to store and retrieve files which are used as macros in an irBlaster sketch I am developing.

Creating new files and reading them works fine. I have also a web function to remove one. That uses SPIFFS.remove(path). I find that when I list the directory contents the file still shows up but now has 0 length.

Is that expected behaviour? Do filenames only disappear after a format?

I can cope with that OK by just treating 0 length files as non-existant, but it would be nice to know if that is how this is supposed to work.

Re: SPIFFS.remove leaves 0 length file

PostPosted: Wed Apr 12, 2017 9:35 am
by martinayotte
On my side, the SPIFS.remove() is working properly and deleted file doesn't appear in openDir() after delete.
Are you sure that your file has been closed with close() before doing a remove() ?

Re: SPIFFS.remove leaves 0 length file

PostPosted: Wed Apr 12, 2017 3:30 pm
by btidey
Thanks for reply.

The file was not open during the remove operation, but it was a bug in my program. Another piece was inadvertently recreating the file with 0 length. I corrected that and after the remove the file is indeed gone.

Re: SPIFFS.remove leaves 0 length file

PostPosted: Thu Aug 02, 2018 9:33 am
by Sathya Hadadi
Which web application you are using to check the files?
Can you please share it?