On 2010-05-03, Baz Walter <baz...@ftml.net> wrote: > On 03/05/10 14:56, Chris Rebert wrote: >>> but how does '..' get resolved in the relative path '../abc.txt'? i'm >>> assuming python must initially use getcwd() internally to do this, and then >>> if that fails it falls back on something else. but what is that something >>> else? is it something that is reproducible in pure python? >> >> I would think that the OS system call, not Python itself, does the >> relative->absolute conversion. > > so there is a discrepancy between some of the std library path functions > (like realpath, getcwd, abspath) and the built-in open function.
Not really. There is a discrepancy between your perception and expectations and the way the Unix filesystem works. > there are files which can be opened for which it is impossible to > resolve their full paths (on some platforms). Sort of. The file in question _has_ a full path, you just can't tell what it is based on the path you used to open it. -- Grant Edwards grant.b.edwards Yow! I smell a RANCID at CORN DOG! gmail.com -- http://mail.python.org/mailman/listinfo/python-list