igrr / mkspiffs

Tool to build and unpack SPIFFS images
MIT License
195 stars 92 forks source link

Support reading and writing ESP32 file timestamps stored in the metadata #67

Open ewpa opened 5 years ago

ewpa commented 5 years ago

... bytes by using CONFIG_SPIFFS_USE_MTIME=1 and CONFIG_SPIFFS_META_LENGTH=4 CPPFLAGS compile flags.

The ESP IDF stores file timestamps in 4 bytes of SPIFFS meta data. By using the above compile flags, this patch restores those timestamps when extracting files from a SPIFFS image file and recreates those timestamps by copying from the sources file(s) when creating a SPIFFS image file.

ewpa commented 5 years ago

@igrr My latest commit goes one step further by also taking into consideration the host architecture endianness. I trust that is in the spirit of what you requested.