DIR *dir_ptr;
struct dirent *dir_entery;
dir_ptr = opendir("/tmp");
while (dir_ptr&&(dir_entery = readdir(dir_ptr))) {
printf("%s \n", dir_entery->d_name);
}
printf("%s \n", strerror(errno));
gives this output:
file_name
dir_name
errno = Remote I/O error
in /tmp
I have one dir and two files when get to readdir after the execution of opendir(dir)
It exits the while and put this error:
errno = Remote I/O error
Why it fails to read the file after the dir in the /tmp
directory?
EREMOTEIO
(Remote I/O error). Perhaps there are permission problems on the target file system. Did you tried your program to run with root (supper user) permission, if you are in Ubuntu try withsudo
- Grijesh Chauhan/tmp
:chmod -R 0777 /tmp
- 0x90ls -la /tmp
? Hide the actual file names if you need to keep them private. - jxh