igrr / mkspiffs

Tool to build and unpack SPIFFS images
MIT License
186 stars 91 forks source link

When a file is 0 bytes on the disk, an empty file gets uploaded #80

Open timkoers opened 3 years ago

timkoers commented 3 years ago

I've got a config.json file that is 0 bytes on the disk. (A nice video explaining 0-byte files here: https://www.youtube.com/watch?v=q6eCv0plATg)

afbeelding

This contents of this file are not getting uploaded to the image upon LittleFS filesystem build and flashing. I've got 3 other files, that are not 0 bytes on the disk and they are getting uploaded perfectly fine. I'm using PlatformIO Home 3.3.3 and core 5.1.0 with Espressif v2.6.3.

EDIT: that's not it. I created a copy of the file (config2.json), which is 0 bytes on the disk and that's getting uploaded properly. config.json is just not getting through for some reason. I looked at the binary file, the config.json file itself is present in the image (with the contents) but the file table lists this file as 0 bytes. Removing all the other files still gives a 0 byte file size Building with a block size of 4096 creates the proper binary that is readable with mklittlefs -l littelfs.bin. The default command creates an unreadable file.