Thomas Allen wrote: > If you'd read the messages in this thread you'd understand why I'm not > using os.walk(): I'm not using it because I need my code to be aware > of the current recursion depth so that the correct number of "../" are > substituted in.
I'm well aware of your messages and your requirements. However you didn't either read or understand what I was trying to tell you. You don't need to know the recursion depths in order to find the correct number of "../". base = os.path.normpath(base) baselevel = root.count(os.sep) for root, dirs, files in os.walk(base): level = root.count(os.sep) - baselevel offset = level * "../" ... See? Christian -- http://mail.python.org/mailman/listinfo/python-list