You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "Gary-Hobson (via GitHub)" <gi...@apache.org> on 2026/01/22 11:53:24 UTC
[PR] fs/fat: add support for FIOC_FILEPATH ioctl [nuttx]
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fs/fat: add support for FIOC_FILEPATH ioctl [nuttx]
Posted by "Donny9 (via GitHub)" <gi...@apache.org>.
Donny9 merged PR #18107:
URL: https://github.com/apache/nuttx/pull/18107
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fs/fat: add support for FIOC_FILEPATH ioctl [nuttx]
Posted by "Gary-Hobson (via GitHub)" <gi...@apache.org>.
Gary-Hobson commented on PR #18107:
URL: https://github.com/apache/nuttx/pull/18107#issuecomment-3798040064
> @Gary-Hobson please take a look at this error:
>
> ```
> Configuration/Tool: sam3u-ek/knsh,CONFIG_ARM_TOOLCHAIN_GNU_EABI
> 2026-01-23 08:33:36
> ------------------------------------------------------------------------------------
> Cleaning...
> Configuring...
> Disabling CONFIG_ARM_TOOLCHAIN_BUILDROOT_OABI
> Enabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
> Building NuttX...
> arm-none-eabi-ld: /github/workspace/sources/nuttx/nuttx section `.data' will not fit in region `kflash'
> arm-none-eabi-ld: region `kflash' overflowed by 356 bytes
> make[1]: *** [Makefile:217: nuttx] Error 1
> make: *** [tools/Unix.mk:542: nuttx] Error 2
> make: Target 'all' not remade because of errors.
> /github/workspace/sources/nuttx/tools/testbuild.sh: line 385: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
> [1/1] Normalize sam3u-ek/knsh
> /usr/bin/bash: line 1: arm-nuttx-elf-gcc: command not found
> /usr/bin/bash: line 1: arm-nuttx-elf-gcc: command not found
> HEAD detached at pull/18107/merge
> Untracked files:
> (use "git add <file>..." to include in what will be committed)
> boards/arm/sam34/sam3u-ek/scripts/kernel-space.ld.tmp
> boards/arm/sam34/sam3u-ek/scripts/memory.ld.tmp
> ```
>
> Seems like this PR increase the size of sam3u-ek
This modification only increases flash usage by 652 bytes. Since the flash usage on sam3u-ek/knsh is already at its limit, its capacity has been increased from 65 KB to 80 KB.
```
Memory region Used Size Region Size %age Used
kflash: 66916 B 65 KB 100.53%
uflash: 0 B 63 KB 0.00%
xflash: 0 B 128 KB 0.00%
ksram1: 4208 B 6 KB 68.49%
usram1: 0 B 4 KB 0.00%
xsram1: 0 B 22 KB 0.00%
sram2: 0 B 16 KB 0.00%
Memory region Used Size Region Size %age Used
kflash: 66264 B 65 KB 99.56%
uflash: 0 B 63 KB 0.00%
xflash: 0 B 128 KB 0.00%
ksram1: 4208 B 6 KB 68.49%
usram1: 0 B 4 KB 0.00%
xsram1: 0 B 22 KB 0.00%
sram2: 0 B 16 KB 0.00%
```
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fs/fat: add support for FIOC_FILEPATH ioctl [nuttx]
Posted by "Gary-Hobson (via GitHub)" <gi...@apache.org>.
Gary-Hobson commented on PR #18107:
URL: https://github.com/apache/nuttx/pull/18107#issuecomment-3784746820
> why not use fatfs in your project, it is more recommend
fatfs is not included in the nuttx codebase.
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fs/fat: add support for FIOC_FILEPATH ioctl [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #18107:
URL: https://github.com/apache/nuttx/pull/18107#issuecomment-3784948036
@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 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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fs/fat: add support for FIOC_FILEPATH ioctl [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #18107:
URL: https://github.com/apache/nuttx/pull/18107#issuecomment-3784017109
@Gary-Hobson please consider including a testing at apps/testing/fs/fat. We will need it to test all NuttX features later
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fs/fat: add support for FIOC_FILEPATH ioctl [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #18107:
URL: https://github.com/apache/nuttx/pull/18107#issuecomment-3789705144
@Gary-Hobson please take a look at this error:
```
Configuration/Tool: sam3u-ek/knsh,CONFIG_ARM_TOOLCHAIN_GNU_EABI
2026-01-23 08:33:36
------------------------------------------------------------------------------------
Cleaning...
Configuring...
Disabling CONFIG_ARM_TOOLCHAIN_BUILDROOT_OABI
Enabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
Building NuttX...
arm-none-eabi-ld: /github/workspace/sources/nuttx/nuttx section `.data' will not fit in region `kflash'
arm-none-eabi-ld: region `kflash' overflowed by 356 bytes
make[1]: *** [Makefile:217: nuttx] Error 1
make: *** [tools/Unix.mk:542: nuttx] Error 2
make: Target 'all' not remade because of errors.
/github/workspace/sources/nuttx/tools/testbuild.sh: line 385: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
[1/1] Normalize sam3u-ek/knsh
/usr/bin/bash: line 1: arm-nuttx-elf-gcc: command not found
/usr/bin/bash: line 1: arm-nuttx-elf-gcc: command not found
HEAD detached at pull/18107/merge
Untracked files:
(use "git add <file>..." to include in what will be committed)
boards/arm/sam34/sam3u-ek/scripts/kernel-space.ld.tmp
boards/arm/sam34/sam3u-ek/scripts/memory.ld.tmp
```
Seems like this PR increase the size of sam3u-ek
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org