Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: lstat(2) upon e and + globbing qualifiers
- X-seq: zsh-workers 45484
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: lstat(2) upon e and + globbing qualifiers
- Date: Fri, 21 Feb 2020 19:45:32 +0000
- In-reply-to: <20121109121237.GA11082@chaz.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20121109121237.GA11082@chaz.gmail.com>
Ping:
2012-11-09 12:12:37 +0000, Stephane Chazelas:
Adding a "e" or "+" qualifier to a globbing pattern seems to
cause zsh to call an unnecessary lstat(2) for each file. No big
deal, just potential performance improvement here.
There's a side effect though when you have read but not search
permission on a directory:
$ strace -fe lstat zsh -c 'echo 2/*'
2/bar 2/foo
$ strace -fe lstat zsh -c 'echo 2/*(e::)'
lstat("2/foo", 0x7fff95492110) = -1 EACCES (Permission denied)
lstat("2/bar", 0x7fff95492110) = -1 EACCES (Permission denied)
zsh:1: no matches found: 2/*(e::)
(reproduced with 5.0 on debian)
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author