Rif: Re: How To Do It Faster?!?

andrea.gavana at agip.it andrea.gavana at agip.it
Thu Mar 31 15:42:22 CEST 2005

Hello Lazslo & NG,

>You can use the stat module to get attributes like last modification
>date, uid, gid etc. The documentation of the stat module has a nice
>example. Probably it will be faster because you are running an external
>program (well, "dir" may be resident but still the OS needs to create a
>new shell and interpret the parameters on every invocation).

Unfortunately, on Windows it does not seem to work very well:

>>> st = os.stat('MyFile.txt')
>>> print st.st_uid

I don't think my user ID is 0...

While with the OS dos command I get:

userid: \\ENI\ag12905

Am I missing something on the stat module? I'm running Python 2.3.4.

Thanks a lot.


More information about the Python-list mailing list