X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Eric Blake <ebb9@byu.net>
Subject:  Re: experimental coreutils-5.94-4
Date: Wed, 1 Mar 2006 17:00:00 +0000 (UTC)
Lines: 30
Message-ID:  <loom.20060301T175126-148@post.gmane.org>
References:  <022820061618.27185.440477D700069FD600006A3122069997350A050E040D0C079D0A@comcast.net> <20060228174432.GB27116@calimero.vinschen.de> <20060301154541.GU3184@calimero.vinschen.de> <loom.20060301T172506-641@post.gmane.org>
Mime-Version:  1.0
Content-Type:  text/plain; charset=us-ascii
Content-Transfer-Encoding:  7bit
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Eric Blake <ebb9 <at> byu.net> writes:

> Oops - see how the link count changed from 21 to 22 when I had a physical
> backing directory?  find (and any other tool that optimizes a recursive
> search to look at (link count - 2) subdirectories and then quit) might
> get confused by the fact that the number of subdirs given by readdir is
> no longer consistent with the link count.
> 

As an example, with findutils-4.3.0-1 and cygwin built today (oldfind in
the 4.3.0 package uses the algorithm of the find utility in 4.2.27; the
find in 4.3.0 changed algorithms to fts() which avoids the subdir
optimization):

$ cd /usr
$ oldfind . -maxdepth 2 -mindepth 1 -name 'lib*' | wc
     70      70    1435
$ oldfind . -noleaf -maxdepth 2 -mindepth 1 -name 'lib*' | wc
    755     755   16168
$ mkdir /cygdrive/c/cygwin/usr/lib
$ oldfind . -maxdepth 2 -mindepth 1 -name 'lib*' | wc
    755     755   16168

Notice that without a physical /usr/lib under the mount point, oldfind did
not traverse into /usr/lib unless I used -noleaf to disable the link
count optimization, because /usr/lib appeared too late in the readdir.

-- 
Eric Blake



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

