-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fs/fat: add support for FIOC_FILEPATH ioctl #18107
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
base: master
Are you sure you want to change the base?
Conversation
|
@Gary-Hobson please consider including a testing at apps/testing/fs/fat. We will need it to test all NuttX features later |
GUIDINGLI
left a comment
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.
why not use fatfs in your project, it is more recommend
fatfs is not included in the nuttx codebase. |
|
@GUIDINGLI the FAT FS from NuttX was implemented from scratch by Greg, and although it could miss one or other feature from FatFS (exFAT is the most important one), NuttX implementation is better for low end devices and also since it is a different implementation some BUGs found on FatFS will not affect our implementation. |
This patch adds support for the FIOC_FILEPATH ioctl command in the FAT filesystem, allowing applications to retrieve the full path of an open file descriptor. Key features: - Implements fat_getfilepath() to construct file paths by traversing parent directories using ".." entries - Adds fat_findlfnstart() helper to locate the start of LFN sequences - Supports both FAT12/16 and FAT32 filesystem types - Handles both regular directories and root directory traversal This functionality is useful for debugging, logging, and applications that need to track file paths at runtime. Signed-off-by: yinshengkai <yinshengkai@bytedance.com>
cae2d53 to
452cc82
Compare
|
@Gary-Hobson please take a look at this error: Seems like this PR increase the size of sam3u-ek |
Summary
This PR adds support for the FIOC_FILEPATH ioctl command in the FAT filesystem, enabling applications to retrieve the full path of an open file descriptor.
Implementation Details
Key features implemented:
Use Cases
This functionality is valuable for:
Testing
The implementation has been tested on FAT32 filesystems and correctly handles: