Is there a way to obtain file-descriptors
for the filenames
obtained from dirent
field d_name
.
Asked
Active
Viewed 769 times
1

jarvis1729
- 147
- 2
- 8
-
1`int fd = openat(dirfd, dirent->d_name, FLAGS);`? – EOF Mar 17 '16 at 15:19
-
Make that `int fd = openat(dirfd(dirp), dirent->d_name, FLAGS);` where `dirp` is the `DIR *` returned by the relevant `opendir()` call. – Nominal Animal Mar 19 '16 at 21:53