os.stat() ?
Agent Drek
drek at smashpow.net
Sun Sep 9 17:23:15 EDT 2001
On Sun, 9 Sep 2001, Ignacio Vazquez-Abrams wrote:
> 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
>
>
/me smacks his forehead
thanks.
--
Derek Marshall
Smash and Pow Inc > 'digital plumber'
http://www.smashpow.net
More information about the Python-list
mailing list