, why are so weird for directories?

Read perms let you list the filenames in the directory but nothing else (e.g.. not contents of files nor metadata like size or file owners).

Write perms let you add/delete/rename files in that directory, but only if exec perms are also present.

Exec perms let you read or write to files that already exist in a directory, but not list the names nor change the names. Hope you already know the filename you're after.

... WHY??

@stsp Hahahaha

C'mon, there must be a reason. It must be one of those little bugs that grew up to be a big and strong independent feature, like dotfiles being hidden.


@stsp I'm guessing it's due to some peculiarity of how inodes were first implemented.

Also, please tell me that you had to remember how directory permissions work, because I always think I know how and then get confused by weird directory modes like 0300, 0200, or 0600.

@JordiGH I did not remember their meaning in detail, no.

But what do you think is wrong with the scheme you described? What would you change if you could?

@stsp I think:

Read: List names in that directory and read file contents, including metadata. This also allows cd'ing into that directory.

Write: Modify names in that directory and file contents, including metadata.

Exec: Allow executing files from that directory, or just do nothing.

Sign in to participate in the conversation

A Mastodon instance for maths people. The kind of people who make \(\pi z^2 \times a\) jokes. Use \( and \) for inline LaTeX, and \[ and \] for display mode.