0

Under unix, symlink/.. refers to the parent directory of the target. While experimenting with symlinks and junctions in Windows, I could see that symlink/.. refers to the parent directory of the symlink itself, not of its target.

So:

A
|--Link_To_C           [ symlink to B/C ]
|--B
   |--C

In Unix: A/Link_To_C/.. resolves to A/B.
In Windows: A/Link_To_C/.. resolves to A

First question: is it always like that?

If so, could I normalize any (local) path in Windows using, for example, os.path.normpath in Python, without having problems for symlinks? The documentation says:

Normalize a pathname by collapsing redundant separators and up-level references so that A//B, A/B/, A/./B and A/foo/../B all become A/B. This string manipulation may change the meaning of a path that contains symbolic links

(worth reading https://stackoverflow.com/questions/34865153/os-path-normpath-and-symbolic-links)

Is it correct to say that this does not apply to Windows?

lb90
  • 101

0 Answers0