From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22346 invoked by alias); 8 Feb 2012 00:47:24 -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: X-Seq: 30191 Received: (qmail 1193 invoked from network); 8 Feb 2012 00:47:22 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) MIME-Version: 1.0 In-Reply-To: <20120207224613.GC4312@Xye> References: <20120206131302.GA46184@Xye> <120206082008.ZM8593@torch.brasslantern.com> <20120207224613.GC4312@Xye> Date: Tue, 7 Feb 2012 16:40:56 -0800 Message-ID: Subject: Re: Re: [PATCH] Use access instead of stat in hashdir From: Bart Schaefer To: Zsh workers Content-Type: text/plain; charset=ISO-8859-1 On Tue, Feb 7, 2012 at 2:46 PM, Raghavendra D Prabhu wrote: > * On Mon, Feb 06, 2012 at 08:20:08AM -0800, Bart Schaefer > wrote: >> } faster rehash when it is done. I came across this when I noticed >> } too many stat calls while 'strace -c' >> >> It also results in treating non-regular files as candidates for being >> in the hash table, unless there's something about access() that is >> implicitly performing the S_ISREG() test. > > Need to verify this but for X_OK the file will need to be regular right ? DESCRIPTION access() checks whether the process would be allowed to read, write or test for existence of the file (or other file system object) whose name is pathname. If pathname is a symbolic link permissions of the file referred to by this symbolic link are tested. [...] Only access bits are checked, not the file type or contents. [...] If the process has appropriate privileges, an implementation may indi- cate success for X_OK even if none of the execute file permission bits are set. Note "or other file system object."