isdir, isfile broken under windows XP?

Matt Gerrans mgerrans at mindspring.com
Thu May 22 02:34:46 EDT 2003


I think it is just the fact that 'recycler' also exists in the current
directory (os.path.abspath(os.curdir)).   Since listdir is not returning the
fully qualified names, your isdir() is looking for those things in the
current directory.   So maybe something like this will do the trick:

filter( lambda a: os.path.isfile('f:\\'+a), os.listdir('f:\\') )

(you could use os.path.join() also).

- Matt






More information about the Python-list mailing list