Mercurial > hg > config
changeset 533:4f20f634f93f
example
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 26 Sep 2013 01:10:27 -0700 |
parents | e1aa8835edb7 |
children | 6ee5d5cca949 |
files | python/example/oswalktest.py |
diffstat | 1 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /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)