os.stat() ?
Ignacio Vazquez-Abrams
ignacio at openservices.net
Sun Sep 9 17:20:12 EDT 2001
On Sun, 9 Sep 2001, Agent Drek wrote:
> Am I wrong in thinking that this should return a value that chmod(1)
> would expect?
>
> $ 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
>
> python2.1.1 on FreeBSD
>
> I'm looking for the best way to get a list of the full attributes of
> a file.
>>> print oct(420)
0644
--
Ignacio Vazquez-Abrams <ignacio at openservices.net>
More information about the Python-list
mailing list