From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5405 invoked by alias); 1 Oct 2014 20:11:54 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19197 Received: (qmail 29884 invoked from network); 1 Oct 2014 20:11:42 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_WEB,RCVD_NUMERIC_HELO,SPF_HELO_PASS,T_FSL_HELO_BARE_IP_2 autolearn=no version=3.3.2 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@zsh.org From: Yuri D'Elia Subject: Re: Empty directories Date: Wed, 01 Oct 2014 22:11:27 +0200 Message-ID: References: <20141001120022.72b2bf53@pwslap01u.europe.root.pri> <20141001142506.52d75405@pwslap01u.europe.root.pri> <141001084733.ZM5806@torch.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 193.106.183.2 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.0 In-Reply-To: On 10/01/2014 09:58 PM, Bart Schaefer wrote: > On Oct 1, 2014 11:15 AM, "Yuri D'Elia" wrote: >> Ok, so maybe we can cut it short and avoid to append a slash on empty >> directories directly on the first run? > > The trouble is there is no way to tell that a directory is empty except by > looking "inside" it. If the directory is network-mounted or contains > thousands of files (or, worse, both) that could be an enormous performance > hit to save you typing one character. > > We might be able to do something with the newly-added short-circuit glob > qualifier, but that doesn't help with the network mount issue, and it still > means manufacturing a path tail, testing it, and then throwing it away > again. Very good point, yes. Something "unexpected" on a same vein happens with glob_complete and repeated slashes. Assuming "compinit" has been called, try with the following for maximum enjoyment: $ anything .//