Mercurial > hg > config
view python/example/oswalktest.py @ 806:5364185dcb9b
i dont use this anywhere yet; lets assume that i wont until i actually will be able to develop on it
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Fri, 28 Oct 2016 17:07:24 -0700 |
parents | 4f20f634f93f |
children |
line wrap: on
line source
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)