# HG changeset patch # User Jeff Hammel # Date 1380183027 25200 # Node ID 4f20f634f93fe5cf89f3f67abf5e9b3250bb5fee # Parent e1aa8835edb72342b3dd7fb1fa52926008ada8c2 example diff -r e1aa8835edb7 -r 4f20f634f93f python/example/oswalktest.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/example/oswalktest.py Thu Sep 26 01:10:27 2013 -0700 @@ -0,0 +1,17 @@ +import os +import shutil +import tempfile + +tmpd = tempfile.mkdtemp() +try: + sub = os.path.join(tmpd, 'sub') + link = os.path.join(tmpd, 'link') + subsub = os.path.join(sub, 'sub') + os.makedirs(sub) + os.symlink(tmpd, link) + os.symlink(tmpd, subsub) + + for item in os.walk(tmpd, followlinks=True): + print item +finally: + shutil.rmtree(tmpd)