This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question about incorrect System path from cygpath with case-sensitivity enabled


On Jan  2 18:33, Andrey Repin wrote:
> Greetings, Bryan Henry!
> 
> > I enabled (some time ago, not recently) case sensitivity on my Windows 8.1
> > system by setting the registry key mentioned in the FAQ here:
> > https://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-casesensitive
> 
> > Today, I updated Cygwin and noticed a message about a failed postinstall
> > script at the end. Here's the excerpt from setup.log.full showing
> > /etc/postinstall/base-files-mketc.sh exiting early:
> 
> > 2016/01/01 15:45:32 running: C:\cygwin\bin\bash.exe --norc --noprofile
> > "/etc/postinstall/base-files-mketc.sh"
> > Directory /C/WINDOWS/System32/drivers/etc does not exist; exiting
> > If directory name is garbage you need to update your cygwin package
> > 2016/01/01 15:45:32 abnormal exit: exit code=1
> 
> > Since this was an existing installation, that postinstall script failing
> > isn't a big deal since the symlinks that it would normally create already
> > exist, but I wanted to dig into why it's failing in the first place in case
> > it is a symptom of something bigger. Taking a look at that script and trying
> > "/usr/bin/cygpath -S -u" for myself, I see now why it failed:
> 
> > [~]$ cygpath -S -u
> > /C/WINDOWS/System32
> > [~]$ file `cygpath -S -u`
> > /C/WINDOWS/System32: cannot open `/C/WINDOWS/System32' (No such file or directory)
> > [~]$ file /C/Windows/System32
> > /C/Windows/System32: directory
> 
> > I get similar results from "cygpath -W". It seems that cygpath has not
> > picked up on the fact that the directory is really "Windows" and not
> > "WINDOWS",
> 
> cygpath uses system calls to return the directories you're asking for.

...and those system calls return information which does not honor
case-sensitivity, unfortunately.

> If a system call return wrong case, cygpath can't do anything to amend it.

It can and it will, at least if the path is a local path.  I just
applied a patch to cygpath to call another OS function to correct the
case of the path returned by GetSystemDirectory and friends.

> You have to fix your system first, then it will just work.

This is nonsense.  It's not the user's fault that the OS returns paths
without honoring the case.  Cygwin tries to support case-sensitivity
(https://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-casesensitive)
and so it makes a lot of sense if cygpath tries to return system paths
using the correct case.

I just uploaded new developer snapshots to https://cygwin.com/snapshots/
Please give cygpath from those snapshots a try.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]