[Issue 9530] std.path should have a function for getting the canonical path to a file or directory

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jul 5 10:34:50 PDT 2017


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

--- Comment #3 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
(In reply to Vladimir Panteleev from comment #2)
> Fmainly because I think historically libc did not provide an easy
> way to canonicalize a path without resolving symlinks.

Resolving the symlinks is kind of the point here, because the idea is to have a
function that gives you a single path to a file when given different paths to
it so that you can know that they're the same file. And if you don't resolve
symlinks, you definitely can't do that. I'd never heard of realpath before, but
looking at its man page, it looks like it does what I'm talking about.

> I'm not sure what to do with Windows, as there is no equivalent for it in
> Windows libcs, and Windows implements symlinks (and reparse points in
> general) very differently.

I really have no idea how Windows symlinks work. So, I have no idea how
possible this sort of thing is with Windows symlinks, but the idea it least is
to be able to take a path name and get a single, canonical path for it so that
you can compare paths and have them be the same for the same file regardless of
how that file was originally referred to. Windows may or may not make that
possible.

--


More information about the Digitalmars-d-bugs mailing list