spiffs
spiffs copied to clipboard
Added SPIFFS_truncate function
Hi,
this pull request should solve issue
https://github.com/pellepl/spiffs/issues/107 and https://github.com/pellepl/spiffs/issues/217
I used SPIFFS_remove function as a template. Complete test not already done, but I think it shuold be ok.
thanks
Hi,
I'm not an expert of Pull request (this is my first one), but I don't know why it failed the check..I modified the type of length parameter from __off_t to u32_t
Any suggestion to solve is appreciated.
Thanks.
99% of the code in SPIFFS_truncate() is common with SPIFFS_remove(), except for the additional length argument and parameters passed internally to spiffs_object_truncate(), so I suggest to write a common internal function SPIFFS_truncate_or_remove() with both length and remove_object flag as arguments and passed to spiffs_object_truncate() as-is, that is called from SPIFFS_remove() and SPIFFS_truncate() stubs instead.
I think having a SPIFFS_ftrunctate() similar to SPIFFS_fremove() (i.e., with a file handle instead of a path) could also be done the same way with little extra efforts.
any update when this pull request will be accepted?
Hi @milamber-ls,
In my opinion @pellepl is not updating anymore the project (maybe he is working on the new version). Since you are using it for esp32 I think you could import the spiffs in "components" folder of your project and modify the source code with my edits.
Thank you @davctv ! This is what I did and it works nicely. The problem in this situation is that every time that I am updating edp-idf I have to go and apply these changes all over again. Every time. From the esp-idf point of view they cant accept the request into esp-idf if this request is not accepted first. catch 22.
Is SPIFFS truncate still in limbo?
Now implemented and merged in https://github.com/pellepl/spiffs/pull/278 + https://github.com/pellepl/spiffs/pull/287.
Thanks, I'll get my project out of mothballs and try it out. Probably suffering from a little "bit rot" by now :)