From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 5270289f for ; Fri, 21 Feb 2020 19:46:23 +0000 (UTC) Received: (qmail 7433 invoked by alias); 21 Feb 2020 19:46:13 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45484 Received: (qmail 18683 invoked by uid 1010); 21 Feb 2020 19:46:13 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr1-f41.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25725. spamassassin: 3.4.2. Clear:RC:0(209.85.221.41):SA:0(-2.0/5.0):. Processed in 4.359774 secs); 21 Feb 2020 19:46:13 -0000 X-Envelope-From: stephane.chazelas@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.221.41 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Ac4xaTDn7+rew7hfD0VbZWavpLxhQuHJnJ+Jf61Y4rs=; b=WRsBpuUDeju1dOCMYpkDjVAlTbG7rQzjElmGY+2F+rHM5/VhgL8GErfmrQP8IN8N9G qBpjWATb4hlpsKgW2ysGa2V6YOED2V79vx2WHdY3l1T0O23B/eQHgDCIktY5oFjKbBK5 5+ryWzu39ZQ6GSzk4PB7qZAs+YK1xkr7aujAaua5FZpRN61KjMmC3KXPOhK/s0Wq/0i3 d8QVD0PILIN2pNfZiUIN8dVr7SxRm0hE/ITtEg2pBwyX5Y78XOKSLLqZLaUItIpsiduD phuUrnHD6fRUphyS18L6Afwb6Npfa2w4kCtlrZW4iSAfvG6RTU06mFzC7K6uuI9O9j+i +6wg== X-Gm-Message-State: APjAAAXLmoad+yAcE8cYlVTA9FB5vfDuJ4AoLEnDGnu2g4JZ21pOJ6Hw E8IGEcD6tiZa7N6L82fH8Zlb4OFB X-Google-Smtp-Source: APXvYqxe8Ke2rErEluU0qLYvxhdaA+TZxvjs/Z/S5LUOzcb9VNq4YweVFotNJCcF1vKCHJukJm5Mkg== X-Received: by 2002:adf:f0c8:: with SMTP id x8mr50849253wro.359.1582314334052; Fri, 21 Feb 2020 11:45:34 -0800 (PST) Date: Fri, 21 Feb 2020 19:45:32 +0000 From: Stephane Chazelas To: zsh-workers@zsh.org Subject: Re: lstat(2) upon e and + globbing qualifiers Message-ID: <20200221194532.bp7imfxvybjgaogs@chazelas.org> Mail-Followup-To: zsh-workers@zsh.org References: <20121109121237.GA11082@chaz.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121109121237.GA11082@chaz.gmail.com> User-Agent: NeoMutt/20180716 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