Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
lstat(2) upon e and + globbing qualifiers
- X-seq: zsh-workers 30788
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: lstat(2) upon e and + globbing qualifiers
- Date: Fri, 9 Nov 2012 12:12:37 +0000
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Hiya.
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