stat module

  • Thread starter Gian Mario Tagliaretti
  • Start date
G

Gian Mario Tagliaretti

Hi guys, maybe is an easy question but there is something I haven't understood

I will post the example for better explain

Python 2.3.4c1 (#2, May 13 2004, 21:46:36)
[GCC 3.3.3 (Debian 20040429)]
import os
mode_list = os.lstat('/etc/passwd')
import stat
mode = stat.S_IMODE(mode_list[0])
print mode
420

now if I chech the permission on /etc/passwd I get

liquid@debian:~$ ls -la /etc/passwd
-rw-r--r-- 1 root root 1077 Apr 28 17:48 /etc/passwd
liquid@debian:~$

which is a 644 file permission.

I've tried to read very carefully the manual and the module description but
there is something that probably I don't understand

Thank's for any help

Mario aka Liquid
 
M

Marius Bernklev

Gian Mario Tagliaretti said:
I've tried to read very carefully the manual and the module
description but there is something that probably I don't understand

644 is base8. 420 is base10.


Marius
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top