-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Allow attribute get on root #7873
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm worried that when _valid
is false the filename is not guaranteed to be proper. Has this been verified?
Also, the ::format
method should be setting these attributes when on-device formatting occurs.
I'll extend my tests and verify the workings of all available methods. Where would you say is the right place to set the attributes on
The first would be most in line with the change in mklittlefs, I guess. |
The The _valid thing still sets off alarms. You're assuming that dirent is all 0'd (which it is, luckily, in the constructor...but only until something writes to it which can happen on rewind() or next() or other calls). Also, this would return the FS date no matter what the subdir it's in which is not what you're going for. Currently, also, if I read the sprintf logic you're doing a lfs_get_attr("") and not lfs_get_attr("/") |
c384cbf
to
9a3f357
Compare
Thanks for the feedback and insights. I have updated the code to a more proper way to get the attributes. Also included is the proposed change to set the attributes on format.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good way to add in the call! Just some minor things and we should be good to go!
9a3f357
to
8b6eb00
Compare
8b6eb00
to
869f066
Compare
When `FS::getCreationTime` isn't implemented in the FS, return 0 not -1, same as other getXXXtime() calls in the File object.
Rebuild entire toolchain instead of manually hacking the tools JSON to ensure repeatability. New mklittlefs sets the new FS timestamp added in esp8266#7873
Rebuild entire toolchain instead of manually hacking the tools JSON to ensure repeatability. New mklittlefs sets the new FS timestamp added in #7873
This PR enables attributes on the root, such as creation/modification time of volume.
After quite some testing I believe the attached changed is the only one required. It didn't seem to break anything in my tests, though I'm not 100% sure, because the use and value of
_valid
in undocumented and unclear to me.Test project available: LittleFSTest
Effects of checking 'c' and 't' attributes on a root node, if:
I'm haven't been able to figure out why situation 3. doesn't respond like 2. If this is an undesirable side effect, I'm hoping someone has a suggestion on fixing it or where to look.