Tuesday, September 17, 2024

Re: rw- directory mode : different ls behavior

On Tue, Sep 17, 2024 at 09:43:27AM +0200, tomas.rippl@tutanota.com wrote:
> I would expect that without the 'x' bit, the directory is not searchable
> and I won't be able to list its contents. But in fact I can, unless I
> use a long format (-l, -g or -n).
>
> Can someone please explain the above behaviour? Thank you. Tom

Very roughly...
The list of files in a directory is information about the directory.
If you chmod -r my-test-dir, this information will no longer be available,
for example.
The file size is information about the files themselves; to read it, you
need to be in the directory. But as you can't, it's unreadable.

--
Denis

No comments:

Post a Comment