Hi,
I'm looking at some Python code and I saw a very strange like like this:
WTF?? I've never seen 5 digits in a chmod permissions number. What exactly does 33152 mean?Code:os.chmod( filename, 33152 )
Printable View
Hi,
I'm looking at some Python code and I saw a very strange like like this:
WTF?? I've never seen 5 digits in a chmod permissions number. What exactly does 33152 mean?Code:os.chmod( filename, 33152 )
You probably need to convert it to octal to make sense of it - it's 100600
User rw only, and some kind of "sticky bit"
The 100000(octal) bit specifies "regular file." I wasn't actually aware that you could manipulate that bit via chmod(), but who knows.
A mode of 10xxxx means it's a regular file.
From /usr/include/linux/stat.h:
I imagine that chmod(2) only looks at the 4 least significant octal digits.Code:#define S_IFSOCK 0140000
#define S_IFLNK 0120000
#define S_IFREG 0100000
#define S_IFBLK 0060000
#define S_IFDIR 0040000
#define S_IFCHR 0020000
#define S_IFIFO 0010000