[Issue 15776] New: symlink documentation wrong: "Relative paths are relative to the current working directory"

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Mar 6 22:42:30 PST 2016


https://issues.dlang.org/show_bug.cgi?id=15776

          Issue ID: 15776
           Summary: symlink documentation wrong: "Relative paths are
                    relative to the current working directory"
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: timothee.cour2 at gmail.com

doc says, for symlink(original, link):

Relative paths are relative to the current working directory, not the files
being linked to or from.

it should be:
link is relative to cwd (if relative), original is relative to link (if
relative), so that in the example below:

buildPath(link.dirName, original).buildNormalizedPath
=buildPath(`d01/pz2.txt`.dirName, `../z2.txt`).buildNormalizedPath
=`z2.txt` = actual location of original wrt cwd, which is != original.
(and this is still valid for directory symlinks)
Perhaps renaming original to original_wrt_link would make this more obvious


tree
.
├── d01
└── z2.txt

std.file.symlink(`../z2.txt`, `d01/pz2.txt`)

.
├── d01
│   └── pz2.txt -> ../z2.txt
└── z2.txt

--


More information about the Digitalmars-d-bugs mailing list