Chat freely about anything...

User avatar
By btidey
#64840 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.
User avatar
By btidey
#64883 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.