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

Pierce Morton pierce.c.morton@gmail.com
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
c:\example\TARG
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
c:\example\TARG\subfolder

However, the reverse (win to nix) works fine:
cygpath "c:\example\junc"
gives you
/cygdrive/c/example/junc
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
c:\thisdirisnotreal\blah
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: <http://cygwin.com/pipermail/cygwin/attachments/20101123/8da04fa2/attachment.obj>
-------------- next part --------------
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list