×

Discussion Board

Results 1 to 2 of 2

Hybrid View

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    9

    trivial file system walker

    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

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7
    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
  •  
×