-
Notifications
You must be signed in to change notification settings - Fork 3k
Filesystem: Include '.' and '..' in directory iteration #4186
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
Conversation
The standard is intentionally vague on if filesystems must have '.' and '..' entries, allowing filesystems to omit this concept completely: http://pubs.opengroup.org/onlinepubs/9699919799/functions/readdir.html However, the '.' and '..' entries are common on FAT filesystems and in most other filesystems. This enables '.' and '..' entries in the FAT filesystem.
bump for review |
Is there any meaningful code size implication with this change? |
@geky Bump |
Here are the code size changes (with K64F, GCC_ARM, and the features-tests-filesystem-fat_filesystem test, all units are bytes):
And I have now ran the full test suite. There is a small change needed to support the '.' and '..' directories, but this would be needed if a different filesystem included these during iteration: |
@simonqhughes Can you review? It looks good to me |
/morph test-nightly |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest failed! |
@bridadan @studavekar timeout or windows seriall error for some targets in the last CI run? Any pointers for those? |
Some how multiple boards were being accessed at once. We should restart this. /morph test-nightly |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
The standard is intentionally vague on if filesystems must have '.' and '..' entries, allowing filesystems to omit this concept completely. However, if '.' and '..' entries are present, they must appear during directory iteration:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/readdir.html
The '.' and '..' entries are common on FAT filesystems and in most other filesystems. Not providing '.' and '..' entries deviates from convention in a way that may cause user's code to not work when ported to a different filesystem.
This enables '.' and '..' entries in the FAT filesystem.
Note: After this patch, '.' and '..' entries will show up during directory iteration. This is a breaking change, but needed to match conventions on host PCs.
I also need to check if the sd-driver tests need updating, but wanted to get this up there for review.
cc @simonqhughes, @theotherjimmy