Discussion Board
trivial file system walker
2005-01-10, 21:09
#1
Registered User
I copied the os.listdir() example to dump the list of files, their date and size to e:/filelog.txt for transferring to something with a bigger screen =)
http://www.proweb.co.uk/~matt/s60_file_enum.py
Registered User
You might also take advantage of the function walk in the standard os.path library which can help you to write recursive file tree browsing code:
>>> def callback(arg, dir, files):
... for file in files:
... print os.path.join(dir, file)
...
>>> os.path.walk('c:', callback, None)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules