delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1996/12/18/10:31:58

From: blroberts AT xactware DOT com (Barry Roberts)
Subject: Re: Q: Case sensitive file names (B17) -Reply
18 Dec 1996 10:31:58 -0800 :
Sender: daemon AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <s2b7b758.037.cygnus.gnu-win32@GATEKEEPER.XACTWARE.COM>
X-Mailer: Novell GroupWise 4.1
Original-To: gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

I haven't downloaded any source, or even gcc yet, but I would be
interested in getting some feedback on the difficulty of changing this.

Judging from the behavior, it seems as though pathname expansion uses
its own mechanism to determine if a file matches the wild card, not the
one built into Win32 (FindFirstFile with the wild card name as a
parameter).  If it's not difficult to switch to using the OS wild card
matching, then wouldn't this automatically give the correct behavior on a
FAT/NTFS/HPFS partition AND a drive mounted from a Unix box that is
case sensitive?  Any ideas?

>>> Richard Donkin <richardd AT cix DOT compulink DOT co DOT uk> 12/15/96 01:01pm
>>>
In-Reply-To: <s2b17797 DOT 037 AT GATEKEEPER DOT XACTWARE DOT COM>
> It seems that the cygnus file and shell utilities are case sensitive when
> performing wildcard expansion, and aren't for an explicit file name.
>  > For example, ls *.cpp will not show HELLO.CPP, but ls hello.cpp will
> show it (as lower case).

FWIW filename completion in bash is also case sensitive.   >  > For the
utilities I have tried (grep, ls, cat), this seems to be true  > whether
> run from cmd or bash.
>  > Is there a way that I can turn off this case sensitivity?  It makes
many of
> the utilities MUCH less useful on FAT/NTFS/HPFS partitions which
> preserve but ignore case.

I don't believe there is a way of doing this.  One workaround is to 
lowercase all files - I use a perl script that goes:

for $filename ( @ARGV ) {
    rename($filename, "\L$filename") or
        warn "lower: could not rename '$filename' - $!\n";
}

I realise this may not always be possible - IMO Cygwin should provide an
 option, probably as part of mount(1), to ensure that the readdir type
system  calls used for wildcarding / filename completion return
lower-cased  filenames, when used on a filesystem that is mounted with
the no-mixed  option.  Of course, all files on that filesystem would then
appear to be  lower case to ls etc.

Richard
-- richardd AT cix DOT compulink DOT co DOT uk                http://www.inside-edge.co.uk/
Inside Edge Consultancy           Client/Server and Internet Applications
PGP key from:  pgp-public-keys AT keys DOT pgp DOT net  -or- 
http://www.four11.com/



-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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