nuttx/fs
Gregory Nutt 97b0235d77 s/dirent: Corrects a problem with opendir() noted by Petteri Aimonen in Bitbucket Issue 132: "opendir() fails for FAT filesystem with trailing slash in path":
I see the following behaviour on NuttX 7.26, where I have SD card mounted on /flash and a directory called "frm" on it:

opendir("/flash")  returns  (DIR *) 0x1000c580
opendir("/flash/") returns (DIR *) 0x1000c5d0
opendir("/flash/frm")  returns (DIR *) 0x1000c620
opendir("/flash/frm/")  returns (DIR *) 0x0

From POSIX specs for opendir(): "A pathname ... that ends with one or more trailing slashes shall be resolved as if a single dot character ( '.' ) were appended to the pathname."

So for mount points, opendir() works correctly, but for FAT32 filesystem it fails to open directory if the path has a trailing slash. I'm not quite sure how to cleanly fix this. Stripping the trailing slash in opendir() would require allocating a separate buffer, while fixing it in the FAT32 code seems somewhat complex due to the short/long filename logic.

It is not a big issue for me, I'm just going to fix it on the application side. But still a small portability and standards compliance issue.

NOTE: You would not see this problem if you call opendir() indirectly in NSH (like 'ls -R /') because NSH contains logic to remove trailing '/' characters from paths.
2018-11-16 11:45:18 -06:00
..
aio fs/aio, libs/libc/aio, sched/mqueue, sched/timer, and sched/signal: Remove the code duplication for SIGEV_THREAD. 2018-11-08 08:19:17 -06:00
binfs Squashed commit of the following: 2018-01-03 16:03:56 -06:00
cromfs tools/gencromfs.c: Was duplicating all mode bits in source directory in CROMFS directory. Some make no sense. In particular, all write-able bits are cleard unconditionally. Executable bits are still copying because there is really no way for the tool to know if the file is executable or not. 2018-03-24 15:05:22 -06:00
dirent s/dirent: Corrects a problem with opendir() noted by Petteri Aimonen in Bitbucket Issue 132: "opendir() fails for FAT filesystem with trailing slash in path": 2018-11-16 11:45:18 -06:00
driver fs/driver: Add register_mtdpartition() for MTD partition 2018-11-08 10:03:07 -06:00
fat s/dirent: Corrects a problem with opendir() noted by Petteri Aimonen in Bitbucket Issue 132: "opendir() fails for FAT filesystem with trailing slash in path": 2018-11-16 11:45:18 -06:00
hostfs fs/hostfs/hostfs.c: Add re-try when hostfs mount() fails 2018-08-26 12:22:08 -06:00
inode fs/inode/fs_fileclose.c: Move file_close() a separate file. It no longer makes since for it to cohabitate with file_detach(). 2018-09-15 13:19:14 -06:00
mmap Fix lots of typos in C comments and Kconfig help text 2018-07-08 18:24:45 -06:00
mount Eliminate a warning found in build testing. 2018-11-09 13:23:12 -06:00
mqueue Standardization of some function headers. 2018-03-13 09:52:27 -06:00
nfs fs/nfs: Update nfs mount to VER3 2018-08-26 13:11:24 -06:00
nxffs File System IOCTLs: Three new IOCTLS were added for SPIFFS, two of which were duplicates. 2018-09-27 12:25:23 -06:00
partition fs/partition: Try MTDIOC_GEOMETRY IOCTL before bops's geometry 2018-11-08 09:41:54 -06:00
procfs drivers/serial/uart_16550.c: Fox UART flow control issue. UART_MCR_RTS need be high even UART_MCR_AFCE is enabled 2018-11-08 10:21:16 -06:00
romfs fs/romfs/fs_romfsutil.c: Make romfs_devread32 more portable 2018-08-26 13:03:01 -06:00
semaphore Standardization of some function headers. 2018-03-13 09:52:27 -06:00
shm fs/: Remove dangling space at the end of lines. 2017-06-28 13:17:55 -06:00
smartfs fs/smartfs/smartfs_smart.c: Current sector should have a space for next entry size. If not, we should move to next sector. 2018-09-14 06:36:55 -06:00
spiffs Trivial update to a comments and to SPIFFS comments and debug output. 2018-09-30 07:15:15 -06:00
tmpfs Remove trailing spaces at the end of lines. 2018-08-13 07:39:38 -06:00
unionfs Merged in hardlulz/modem-3.0-nuttx/fix-sem-EINTR (pull request #603) 2018-02-20 18:24:53 +00:00
userfs Remove all usage of printf() from the OS. That is not an acceptable context for the use of an application-oriented interface that depends on a task-specific file descriptor and C buffered I/O. 2018-03-03 15:20:21 -06:00
vfs Fix compiler error and warning when CONFIG_NET_SENDFILE=y 2018-11-09 11:17:43 -06:00
.gitignore
fs_initialize.c
Kconfig This commit brings in an inital port of the SPIFFS flash file system into NuttX. The file system is still untested at this point (and subject to some additional review). It is, however, marked EXPERIMENTAL should this should not cause a problem for anyone. 2018-09-24 18:05:09 -06:00
Makefile This commit brings in an inital port of the SPIFFS flash file system into NuttX. The file system is still untested at this point (and subject to some additional review). It is, however, marked EXPERIMENTAL should this should not cause a problem for anyone. 2018-09-24 18:05:09 -06:00