Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: case-insensitive globbing



James Devenish wrote:
> In message <20040308124027.GA15505@xxxxxxxxxxxxxxxxxxxxx>
> on Mon, Mar 08, 2004 at 08:40:27PM +0800, James Devenish wrote:
> > In message <5792.1078749261@xxxxxxx>
> > on Mon, Mar 08, 2004 at 12:34:21PM +0000, Peter Stephenson wrote:
> > > > % ls /tmp/blah
> > > > DATE
> > > > % rehash
> > > > % where date
> > > > /tmp/blah/date
> > > > /bin/date
> 
> But, now I note:
> 
> % where DATE
> /tmp/blah/DATE
> /bin/DATE
> 
> So...fair enough. An odd experience, but does make sense. For all I
> know, this might even be an Apply kludge to make ported POSIX software
> work in a case-insensitive environment (I haven't looked at how zsh
> queries the OS for these files). [BTW: I received your reply after I
> had already written this e-mail.] On a related note:
> 
> % ls -l =date
> -r-xr-xr-x  1 root  wheel  19276 24 Sep 14:51 /bin/date*
> % ls -l =DATE
> -r-xr-xr-x  1 admin  wheel  19276 24 Sep 14:51 /tmp/blah/DATE*
> 
> Not complaining about this -- just pointing it out so that everyone's
> aware of it. I don't know how this and other such letter-case issues are
> handled in Cygwin. Perhaps there could be a footnote to the caseglob

The difference is that `where' is looking for all occurrence, so is
explicitly searching for either /path/to/date or /path/to/DATE.  If that
matches, it will not try to normalise the name.  This is the only
arguable bug; I know you're not arguing it is a bug, but it's the only
candidate for any change that I can see.  However, it requires special
knowledge about the filing system.

On the other hand, `=' is just looking at the hash table for where
either date or DATE lives.  This gets created once and for all the first
time it searches the directory or when you do `rehash'.  In this case it
browses the directory, so gets the canonical name.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************



Messages sorted by: Reverse Date, Date, Thread, Author