Obtaining the attributes and properties of a folder recursively.
Tino Wildenhain
tino at wildenhain.de
Fri Mar 20 04:58:44 EDT 2009
venutaurus539 at gmail.com wrote:
> Hello all,
> Is there any way to list out all the properties (name,
> type, size) and attributes( Accesstime, mod time, archived or readonly
> etc) of a folder and its contents recursively. Should I need ot go
> inside each and every directory to list them? This has to be for
> Windows.
> I have to obtain the following attriubtes of all the files
> recursively in a directory:
>
> NAME\ FILE CREATION TIME \ MODIFICATION TIME \ ACCESS TIME \
> ATTRIBUTES \ ACLs \ File SIze \
Just some hints you might want to check:
os.walk
>>> help(os.walk)
and os.stat
please see the example for os.walk - this
would work on every platform supported by
python.
for acls, a little more work would be needed
if you want something filesystem specific but
posix style information is included with stat()
Regards
Tino
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3241 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20090320/098e55f0/attachment-0001.bin>
More information about the Python-list
mailing list