* /bin/pwd, cygpath -wa fail under native symlink
@ 2019-12-26 6:56 Ernie Rael
2020-01-07 17:00 ` How to get the drive a file is on (was Re: /bin/pwd, cygpath -wa fail under native symlink) Ernie Rael
0 siblings, 1 reply; 2+ messages in thread
From: Ernie Rael @ 2019-12-26 6:56 UTC (permalink / raw)
To: cygwin
(CYGWIN_NT-6.1 spirit 3.1.1(0.340/5/3) 2019-12-18 09:28 x86_64 Cygwin, win7)
The windows root is C:, cygwin root is on F:.
A native symlink under C: that points into F: gets
an incorrect result from cygpath -wa.
Notice that when the current directory is the target of the symlink
then the result is ok. But any deeper in the tree fails. To summarize:
   @ /a/src/jvi-dev/jvi
$ cygpath -wa .
C:\f\src\jvi-dev\jvi <<<<<<< correct
   @ /a/src/jvi-dev/jvi/src
$ cygpath -wa .
C:\a\src\jvi-dev\jvi\src <<<<<<< fail
=== more detail ===
   @ /a/src/jvi-dev
$ ls -l jvi
lrwxrwxrwx 1 erra None 18 Dec 23 15:16 jvi -> /f/src/jvi-dev/jvi
   @ /a/src/jvi-dev
$ junction jvi
Junction v1.06 - Windows junction creator and reparse point viewer
Copyright (C) 2000-2010 Mark Russinovich
Sysinternals - www.sysinternals.com
C:\a\src\jvi-dev\jvi: SYMBOLIC LINK
  Print Name    : C:\f\src\jvi-dev\jvi
  Substitute Name: \??\C:\f\src\jvi-dev\jvi
   @ /a/src/jvi-dev
$ cygpath -wa jvi
C:\a\src\jvi-dev\jvi
   @ /a/src/jvi-dev
$ cd jvi
   @ /a/src/jvi-dev/jvi
$ cygpath -wa .
C:\f\src\jvi-dev\jvi <<<<<<< correct
   @ /a/src/jvi-dev/jvi
$ cd src
   @ /a/src/jvi-dev/jvi/src
$ cygpath -wa .
C:\a\src\jvi-dev\jvi\src <<<<<<< fail
=== some possibly relevent stuff from the mount table
$ mount
F:/cygwin64 on / type ntfs (binary,auto)
C:/f on /f type ntfs (binary,user)
F:/c on /c type ntfs (binary,user)
F: on /cygdrive/f type ntfs (binary,posix=0,user,noumount,auto)
--
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* How to get the drive a file is on (was Re: /bin/pwd, cygpath -wa fail under native symlink)
2019-12-26 6:56 /bin/pwd, cygpath -wa fail under native symlink Ernie Rael
@ 2020-01-07 17:00 ` Ernie Rael
0 siblings, 0 replies; 2+ messages in thread
From: Ernie Rael @ 2020-01-07 17:00 UTC (permalink / raw)
To: cygwin
I need to find out the drive on which some files reside.
I need to make some links from a tmp dir to the files from a script. So
I need to determine where they reside so I can figure out which tmp dir
to use. Hard links, not running as administrator.
I tried cygpath -wa and /bin/pwd. They fail in some cases as described
below. If this is a problem for cygwin, is there a win7 command I can use?
-ernie
On 12/25/2019 2:05 PM, Ernie Rael wrote:
> (CYGWIN_NT-6.1 spirit 3.1.1(0.340/5/3) 2019-12-18 09:28 x86_64 Cygwin,
> win7)
>
> The windows root is C:, cygwin root is on F:.
> A native symlink under C: that points into F: gets
> an incorrect result from cygpath -wa.
>
> Notice that when the current directory is the target of the symlink
> then the result is ok. But any deeper in the tree fails. To summarize:
>
> Â Â Â @ /a/src/jvi-dev/jvi
> $ cygpath -wa .
> C:\f\src\jvi-dev\jvi <<<<<<< correct
> Â Â Â @ /a/src/jvi-dev/jvi/src
> $ cygpath -wa .
> C:\a\src\jvi-dev\jvi\src <<<<<<< fail
>
> === more detail ===
>
> Â Â Â @ /a/src/jvi-dev
> $ ls -l jvi
> lrwxrwxrwx 1 erra None 18 Dec 23 15:16 jvi -> /f/src/jvi-dev/jvi
>
> Â Â Â @ /a/src/jvi-dev
> $ junction jvi
>
> Junction v1.06 - Windows junction creator and reparse point viewer
> Copyright (C) 2000-2010 Mark Russinovich
> Sysinternals - www.sysinternals.com
>
> C:\a\src\jvi-dev\jvi: SYMBOLIC LINK
>   Print Name    : C:\f\src\jvi-dev\jvi
> Â Â Substitute Name: \??\C:\f\src\jvi-dev\jvi
>
> Â Â Â @ /a/src/jvi-dev
> $ cygpath -wa jvi
> C:\a\src\jvi-dev\jvi
>
> Â Â Â @ /a/src/jvi-dev
> $ cd jvi
>
> Â Â Â @ /a/src/jvi-dev/jvi
> $ cygpath -wa .
> C:\f\src\jvi-dev\jvi <<<<<<< correct
>
> Â Â Â @ /a/src/jvi-dev/jvi
> $ cd src
>
> Â Â Â @ /a/src/jvi-dev/jvi/src
> $ cygpath -wa .
> C:\a\src\jvi-dev\jvi\src <<<<<<< fail
>
> === some possibly relevent stuff from the mount table
>
> $ mount
> F:/cygwin64 on / type ntfs (binary,auto)
> C:/f on /f type ntfs (binary,user)
> F:/c on /c type ntfs (binary,user)
> F: on /cygdrive/f type ntfs (binary,posix=0,user,noumount,auto)
>
>
> --
> 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
>
>
>
--
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-07 17:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-26 6:56 /bin/pwd, cygpath -wa fail under native symlink Ernie Rael
2020-01-07 17:00 ` How to get the drive a file is on (was Re: /bin/pwd, cygpath -wa fail under native symlink) Ernie Rael
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).