Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(python) meaning of st_mode

Tags:

python

Can anyone tell me what is the meaning of the number from the ST_MODE function?

Example:

>>>import os
>>>stat = os.stat('/home')  
>>>print stat.st_mode  
16877  

it prints 16877. What is that for?

like image 278
Egy Mohammad Erdin Avatar asked Nov 03 '10 13:11

Egy Mohammad Erdin


1 Answers

It's the permission bits of the file.

>>> oct(16877)
'040755'

See the various stat.S_* attributes for more info.

like image 116
Ignacio Vazquez-Abrams Avatar answered Oct 12 '22 14:10

Ignacio Vazquez-Abrams