Reputation: 101
It seems only current user's permission can be checked via access()
.
(Example: rwx
).
Generally many file managers (Nautilus, Dolphin, Thunar, PCManFM, emelFM2, etc...) display the permissions for all of three subjects (Example: rwxr-xr-x
) somehow.
How to check the permission for all of three subjects (user, group, other users)?
Upvotes: 0
Views: 189
Reputation: 5473
Take a look a the stat function. It returns a structure with the permissions.
man 2 stat
The structure is also called stat, and includes a protection field st_mode.
Upvotes: 1