PermissionExt.mode() octal representation

Hello,

I’m currently build a programm that analyzes permissions, and since I’m working on Linux, I’m using PermissionsExt.

When converting the u32 result from the mode function into a octal representation, I’m getting output like:

0o40755
0o100644

Surely the last 3 digits are the masked permission groups, but what does the prepended data mean?

Thanks for any advice.

That value comes from the st_mode field off the stat system call. The includes both the standard permission bits, but also includes file type information that the C macros S_ISDIR etc look at: https://linux.die.net/man/2/stat

Thanks for your answer.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.