Gary-Hobson opened a new pull request, #18107:
URL: https://github.com/apache/nuttx/pull/18107

   ## 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:
   - **fat_getfilepath()**: Constructs file paths by traversing parent 
directories using ".." entries
   - **fat_findlfnstart()**: Helper function to locate the start of Long File 
Name (LFN) sequences  
   - Supports both FAT12/16 and FAT32 filesystem types
   - Properly handles both regular directories and root directory traversal
   - Includes boundary checks and error handling for robustness
   
   ## Use Cases
   
   This functionality is valuable for:
   - Debugging and troubleshooting filesystem operations
   - Logging and audit trails that need full file paths
   - Applications that need to track or display file paths at runtime
   - Tools that introspect file descriptor information
   
   ## Testing
   
   The implementation has been tested on FAT32 filesystems and correctly 
handles:
   - Files in nested directories
   - Long file names (LFN)
   - Root directory files
   - Path reconstruction through parent directory traversal


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to