A
A
alexaasha2018-08-31 18:11:25
linux
alexaasha, 2018-08-31 18:11:25

R,w,x for files and folders?

Suppose the file has the following permissions: rwxr----x. For folders, x means that I (not the owner or group member) can enter the folder, view the inode, but cannot view the contents. I don't quite understand this contradiction. Those. I enter the folder, but I don't see the files? And for files like: I can run, but I can’t read the contents, i.e. code (if we are talking about an executable file)? Something strange.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
SagePtr, 2018-08-31
@alexaasha

In the case of a folder - if there is an x ​​attribute, but no r attribute, you cannot read the contents of the folder, but you can work with the files in it - read and write (if you have rights), referring to the files by name. If there is no x attribute, then you can't access the folder or its subfolders/files in any way, regardless of their attributes.

S
Saboteur, 2018-09-01
@saboteur_kiev

When accessing a folder, you simply read the contents of "a file with a list of names in this folder".
When referring to a specific file or folder by the full path, the main thing for you is to be able to go to the directory where this file is located.
These are different operations - to read a list of a directory, and to access a direct path to a file or directory.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question