symbolic links to /cygdrive/X/xxx with capital letter X

Arthur Norman acn1@cam.ac.uk
Fri Jun 12 07:06:24 GMT 2020


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, 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!]

Arthur



More information about the Cygwin mailing list