Created
October 15, 2012 21:33
-
-
Save mleinart/3895683 to your computer and use it in GitHub Desktop.
os.walk with followlinks=true on python 2.4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _walk(*args, **kwargs): | |
for root,dirs,files in os.walk(*args, **kwargs): | |
for dir in dirs: | |
qualified_dir = os.path.join(root,dir) | |
if os.path.islink(qualified_dir): | |
for x in os.walk(qualified_dir, **kwargs): | |
yield x | |
yield (root, dirs, files) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment