[Tutor] directory traversal help

Monika Jisswel monjissvel at googlemail.com
Fri Jul 4 23:27:17 CEST 2008


the fact that it fails shoul be due to some windows restriction about trash
& some hidden files,
to bypass that you can add  a filter in here

def walk(dir):
  for name in os.listdir(dir):
      #the following line is the filter
      if name != 'Trash can' or name !=  'some hidden directory name':
          path = os.path.join(dir,name)
          if os.path.isfile(path):
               .....
      else:
          pass
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080704/fdf33b42/attachment.htm>


More information about the Tutor mailing list