delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/06/12/07:05:58

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 50BB538708DC
Authentication-Results: sourceware.org;
dmarc=pass (p=none dis=none) header.from=yandex.ru
Authentication-Results: sourceware.org;
spf=pass smtp.mailfrom=anrdaemon AT yandex DOT ru
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail;
t=1591959902; bh=gdEVYtyEQ7hJHXDy++yrwGrlaiaapc7X5OZnKSc2Swg=;
h=In-Reply-To:Subject:To:Reply-To:From:Message-ID:References:Date;
b=J3NNAP8QoU7DmuiCjbcwBUYxiDL74VoMKMJlJAoDYpI6GD0DPHBhcUZv4sJrQ5yMN
GP22awc5D8r8U95GyBX0gz1NlCCWdVhZQszXvvAarGi2ffL7OKoaqKLnbIM9zEk/q7
kmn7Y6ruIf8pWdcnVmQodtc61a7T3nbQkASHAuxI=
Authentication-Results: mxback13g.mail.yandex.net;
dkim=pass header.i=@yandex.ru
Date: Fri, 12 Jun 2020 14:03:53 +0300
From: Andrey Repin <anrdaemon AT yandex DOT ru>
X-Mailer: The Bat! (v6.8.8) Home
X-Priority: 3 (Normal)
Message-ID: <63059339.20200612140353@yandex.ru>
To: Arthur Norman <acn1 AT cam DOT ac DOT uk>, cygwin AT cygwin DOT com
Subject: Re: symbolic links to /cygdrive/X/xxx with capital letter X
In-Reply-To: <alpine.WNT.2.00.2006120735160.21688@panamint>
References: <alpine DOT WNT DOT 2 DOT 00 DOT 2006120735160 DOT 21688 AT panamint>
MIME-Version: 1.0
X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_THEBAT,
RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS,
TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <http://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <http://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Reply-To: cygwin AT cygwin DOT com
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

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...

--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019