* Problem with /cygdrive and (#i) globbing flag
@ 2002-07-17 19:14 Vagn Johansen
2002-07-17 19:42 ` Peter Stephenson
0 siblings, 1 reply; 3+ messages in thread
From: Vagn Johansen @ 2002-07-17 19:14 UTC (permalink / raw)
To: zsh-workers
For some reasong the cygdrive prefix does not work with the
globbing flag #i (ignore case).
See the last 'ls' line. The one with no matches.
/>ls [cC]*
CYGWIN.TXT cygwin.PIF cygwin.bat cygwin.ico
/>ls (#i)c*
CYGWIN.TXT cygwin.PIF cygwin.bat cygwin.ico
/>ls (#i)/c*
/CYGWIN.TXT /cygwin.PIF /cygwin.bat /cygwin.ico
/>ls /cygdrive/c/c*
/cygdrive/c/chop.txt /cygdrive/c/cygwin.zip
/>ls (#i)/cygdrive/c/c*
zsh: no matches found: (#i)/cygdrive/c/c*
/>
My .zshrc:
#!/usr/local/bin/zsh -f
path=(/usr/bin $path)
setopt extendedglob
autoload -U compinit
compinit -C # > ~/compinit.out
PS1='%~>'
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Problem with /cygdrive and (#i) globbing flag
2002-07-17 19:14 Problem with /cygdrive and (#i) globbing flag Vagn Johansen
@ 2002-07-17 19:42 ` Peter Stephenson
2002-07-17 22:23 ` Vagn Johansen
0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2002-07-17 19:42 UTC (permalink / raw)
To: Zsh hackers list
"Vagn Johansen" wrote:
> />ls /cygdrive/c/c*
> /cygdrive/c/chop.txt /cygdrive/c/cygwin.zip
> />ls (#i)/cygdrive/c/c*
> zsh: no matches found: (#i)/cygdrive/c/c*
The problem is that the /cygdrive is a bogus directory. To do
case-insensitive matching, zsh has to compare every entry in every
directory to see if it matches, even if it doesn't contain wildcards.
So it starts be looking at all the files in /, and fails to find
cygdrive.
I think you can get away with `mkdir /cygdrive' --- at least it seems to
work for me. Now zsh can see it when it looks at the root directory,
but cygwin still treats the path specially, so reading /cygdrive shows
all the drives.
Another sure-fire method is to put the (#i) after the bit you don't need
to compare case-insensitively, i.e. /cygdrive/c/(#i)c*. This should be
faster, for reasons which the first paragraph should indicate.
Of course, zsh doesn't *need* to do all that work to get case
insensitivity under Windows, but it would be hard work convincing it
internally.
--
Peter Stephenson <pws@csr.com> Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK Tel: +44 (0)1223 392070
**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential
and/or privileged material.
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by
persons or entities other than the intended recipient is
prohibited.
If you received this in error, please contact the sender and
delete the material from any computer.
**********************************************************************
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Problem with /cygdrive and (#i) globbing flag
2002-07-17 19:42 ` Peter Stephenson
@ 2002-07-17 22:23 ` Vagn Johansen
0 siblings, 0 replies; 3+ messages in thread
From: Vagn Johansen @ 2002-07-17 22:23 UTC (permalink / raw)
To: Zsh hackers list
From: "Peter Stephenson"
> I think you can get away with `mkdir /cygdrive' --- at least it seems to
> work for me. Now zsh can see it when it looks at the root directory,
> but cygwin still treats the path specially, so reading /cygdrive shows
> all the drives.
This does not seem change anything apart from being able to complete
/cyg<TAB>
to /cygdrive (but not the subdirectories like "zstyle .. fake-files .. "
can).
> Another sure-fire method is to put the (#i) after the bit you don't need
> to compare case-insensitively, i.e. /cygdrive/c/(#i)c*. This should be
> faster, for reasons which the first paragraph should indicate.
Yep, this works.
The reason I bumped into this problem is because I compiled
my own zsh with implicit '(#i)' in front of all filename generation
occurrences.
By your description of the zsh internals this is a crappy approach.
This is a major nuisance: If I want to do something like
grep na*/100/src/*.{c,h,cpp}
I really have to use
grep (#i)na*(#I)/100/(#i)src/*.{c,h,cpp}
> Of course, zsh doesn't *need* to do all that work to get case
> insensitivity under Windows, but it would be hard work convincing it
> internally.
>
I assume you mean that zsh does a lot of work because it thinks the
underlying file
system is case-sensitive.
Vagn Johansen
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-07-17 22:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-17 19:14 Problem with /cygdrive and (#i) globbing flag Vagn Johansen
2002-07-17 19:42 ` Peter Stephenson
2002-07-17 22:23 ` Vagn Johansen
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).