From: Stephane Chazelas <stephane.chazelas@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: lstat(2) upon e and + globbing qualifiers
Date: Fri, 21 Feb 2020 19:45:32 +0000 [thread overview]
Message-ID: <20200221194532.bp7imfxvybjgaogs@chazelas.org> (raw)
In-Reply-To: <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
prev parent reply other threads:[~2020-02-21 19:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-09 12:12 Stephane Chazelas
2020-02-21 19:45 ` Stephane Chazelas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200221194532.bp7imfxvybjgaogs@chazelas.org \
--to=stephane.chazelas@gmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).