public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andrey Repin <anrdaemon@yandex.ru>
To: Arthur Norman <acn1@cam.ac.uk>, cygwin@cygwin.com
Subject: Re: symbolic links to /cygdrive/X/xxx with capital letter X
Date: Fri, 12 Jun 2020 14:03:53 +0300	[thread overview]
Message-ID: <63059339.20200612140353@yandex.ru> (raw)
In-Reply-To: <alpine.WNT.2.00.2006120735160.21688@panamint>

Greetings, Arthur Norman!

> This running on Windows 10 1909 and cygwin has been updated to the latest 
> version. The effect was also visible on a freshly installed minimal cygwin 
> put on an almost fresh Windows 10 VM.

> Cygwin these days seems to have a behaviour that confuses me regarding the 
> case of a disk name:

>> ln -s "/cygdrive/c/Program Files" pf1
>> ln -s "/cygdrive/C/Program Files" pf2
>> ls -l pf*
> lrwxrwxrwx 1 acn1 None 25 Jun 12 07:37 pf1 -> /cygdrive/c/Program Files
> lrwxrwxrwx 1 acn1 None 20 Jun 12 07:37 pf2 -> /mnt/C/Program Files
>> cygpath -ma ./pf1
> C:/cygwin64/home/acn1/pf1

> You see from the above that when I use cygpath to convert from a cygwin 
> name the drive letter C: is returned in upper case. When that ends up 
> after "/cygdrive" the path behaves as I expect almost everywhere by is 
> treated specially for symbolic links. This seems to be a relatively new 
> behaviour and it bit me!

> [Use-case: I wanted to convert cygwin paths to be "very absolute" so that 
> eg my home directory is not rendered as /home/acn1 but as 
> /cygdrive/c/cygwin64/home/acn1,

cygpath is not meant to replace realpath/readlink.
And you've got exactly what you asked for.
-m returns Windows path with forward slashes.
-a returns absolute path.

> so I had a few lines of shell script to
> achieve that. I was building a package and I build both a cygwin32 and a 
> cygwin64 version, so the "very absolute" paths are portable between the 
> two worlds, both of which were important when I first set this up. Things 
> recently broke and on investigation it was because somewhere deep in 
> build scripts links to /mnt/C/... had been set up and were not usable. I 
> can of course work round the issue but being confident I have spotted all 
> cases causes me work!]

readlink -e ./pf1

man readlink


-- 
With best regards,
Andrey Repin
Friday, June 12, 2020 14:01:51

Sorry for my terrible english...


  reply	other threads:[~2020-06-12 11:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-12  7:06 Arthur Norman
2020-06-12 11:03 ` Andrey Repin [this message]
2020-06-12 17:51   ` Wayne Davison
2020-06-13 20:47     ` Andrey Repin
2020-06-13 23:33       ` Wayne Davison
2020-06-30 11:14 ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63059339.20200612140353@yandex.ru \
    --to=anrdaemon@yandex.ru \
    --cc=acn1@cam.ac.uk \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).