os.stat() ?

Fredrik Lundh fredrik at pythonware.com
Mon Sep 10 02:01:26 CEST 2001


"Agent Drek" wrote:
> $ touch myfile
> $ ls -l myfile
> -rw-r--r--  1 drek  pow  0 Sep  9 17:07 myfile
>
> import os, stat
> print os.stat('myfile')[stat.ST_MODE] & 0777
>
> I get '420' from os.stat

>>> oct(420)
'0644'

</F>





More information about the Python-list mailing list