Date: Mon, 27 Mar 2006 22:14:16 -0800
From: Martin Kelly <[EMAIL PROTECTED]>
...>
Anyway, do you have anything in mind for how to use isfil, isdir, etc. in
this program?
Interesting! --I haven't used os.walk() for a while, and just looking at
it(as in late at night): it seems like os.walk() doesn't dive into
directories that are sym-links. So since directories and files are
separated by os.walk(), all that would apply to your original code would
be 'islink'.
So in the hot debated 'file' section you could say, to give an example,
and if that's what you want to do (e.g. if symlinks point outside of your
'top'
for file in files:
if islink(file):
continue
In my environment, and more recently, I have used mostly
glob.glob('pattern') , and that result wants to be filtered through
isfile, isdir, islink most of the time.
My original comment about checking also the file type was meant to be of
more general nature.
- Horst
_______________________________________________
EUGLUG mailing list
[email protected]
http://www.euglug.org/mailman/listinfo/euglug