I have a directory that have the r
permission bit:
dr-------- 3 robert robert 4096 2017-12-17 03:47 dir
This directory has two files and one directory:
file 1.txt file 2.txt subdir
When I run the command ls dir
(from the robert
account), I get an error alongside the content of the directory:
ls: cannot access dir/file 1.txt: Permission denied
ls: cannot access dir/file 2.txt: Permission denied
ls: cannot access dir/subdir: Permission denied
file 1.txt file 2.txt subdir
Why does ls
display an error even though it is able to display the contents of directory without any problem?
read()
as a list of names. Perhaps only for backwards compatibility, but anyway. But I'm not sure, I seem to recall seeing that on some BSD, but I don't have any current ones to check on. – ilkkachu Feb 03 '20 at 18:09