-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added SPIFFS_truncate function #218
base: master
Are you sure you want to change the base?
Conversation
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? |
Thanks, I'll get my project out of mothballs and try it out. Probably suffering from a little "bit rot" by now :) |
Hi,
this pull request should solve issue
#107
and
#217
I used SPIFFS_remove function as a template. Complete test not already done, but I think it shuold be ok.
thanks