I've been using LittleFS on the ESP32 for 2 years now and I'm really happy with it. Now, though, I tried to make an `ftruncate()` call to trim a file to size, only to find it's not implemented in the esp-littlefs virtual file system. LittleFS supports the function and the VFS even has a pointer member to the truncation function, but it not populated.
So I wrote my own function and added it to the VFS via the `.truncate_p` entry. However, when I compile, the linker throws the following error…
Code: Select all
undefined reference to `ftruncate'
Has anyone managed to successfully implement an ftruncate() function in the `esp-littlefs`? How did you go about it?