cygpath unable to translate the *nix path to an NTFS junction point

Pierce Morton
Tue Nov 23 08:04:00 GMT 2010

I've recently installed cygwin using the web installer, and have found
an error in the way that cygpath translates junction point paths from
*nix to Windows paths when dealing with a junction point.

If you've got a junction point (let's call it JUNC, located at
c:\example\junc ) and a real folder TARG (located at c:\example\TARG )
and your junction point points to TARG:
cygpath -w /cygdrive/c/example/junc
will give you
as your output instead.

This leaves cygpath completely unable to translate the original path
of an NTFS junction.  This is proving to be a problem for me (I'm
trying to use the output of cygpath for the equivalent of a backtick
operation in another script...)

Variations on this produce similar results, for example
cygpath -w /cygdrive/c/example/junc/subfolder
will give you

However, the reverse (win to nix) works fine:
cygpath "c:\example\junc"
gives you
without the faulty translation.

Interestingly enough, cygpath does not normally seem to care whether
or not a folder really exists.
cygpath -w /cygdrive/c/thisdirisnotreal/blah
will give you
even if "thisdirisnotreal" doesn't exist in the filesystem.  It is
only in this special case that cygpath seems to care what is really in
its path.

I haven't taken a look at the C source yet, so I'm not sure whether
this problem lies in cygpath itself or the cygwin API layer.

-Pierce Morton
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 41593 bytes
Desc: not available
URL: <>
-------------- next part --------------
Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list