os.path.walk and symbolic links
Bernhard Herzog
herzog at online.de
Thu Aug 24 13:43:33 EDT 2000
More information about the Python-list mailing list
Thu Aug 24 13:43:33 EDT 2000
- Previous message (by thread): os.path.walk and symbolic links
- Next message (by thread): Strictly 'local' threads in Python?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
François Pinard <pinard at iro.umontreal.ca> writes: > Hi, people. > > By any chance, is there a known, or easy idiom so `os.path.walk' would > follow symbolic links to directories (a bit like `find -follow')? > > If no, I could probably easily simulate it by having the walker function > to call itself with symbolic link definitions, but then, I would have > another little problem, as `os.path.join' does not simplify the result > when its second argument is relative (yet it does the proper thing when > the second argument is absolute). For example, with 1.5.2 on Linux: > > >>> os.path.join('/abc/def/ghi', '../xyz') > '/abc/def/ghi/../xyz' Well, this is all it can do. If ghi is a symbolic link, this may not be the same file as /abc/def/xyz > while I would like to get: > > '/abc/def/xyz' Just run it through os.path.normpath() after the join. -- Bernhard Herzog | Sketch, a drawing program for Unix herzog at online.de | http://sketch.sourceforge.net/
- Previous message (by thread): os.path.walk and symbolic links
- Next message (by thread): Strictly 'local' threads in Python?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list