Discussion: TampLFS, a compression layer for LittleFS.
Hey all!
I just released the first version of tamp-lfs, which is basically a wrapper around LittleFS that uses Tamp for compressing/decompressing. I'd like to add opt-in support in littlefs-python and esp_littlefs (I'm maintainers of both), but would like to get some thoughts/feedback/approval from @geky and other prominent members of the LittleFS community.
In a nutshell, you can pass in the TAMPLFS_O_COMPRESS flag when opening a file, and all subsequent writes will be automatically compressed by Tamp prior to disk. On read, compressed data is automatically detected and transparently decompressed. This is achieved by a magic marker in the 0x80 (relatively arbitrarily chosen, doesn't collide with any popular project that i know of) attribute. This attribute also contains the decompressed size, so a lot of operations can be done in O(1).
Thanks for looking!
Source: littlefs-project/littlefs