bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Conversion of GNU find to use gnulib's fts interface


From: James Youngman
Subject: Conversion of GNU find to use gnulib's fts interface
Date: Sat, 30 Jul 2005 23:27:09 +0100
User-agent: Mutt/1.5.9i

Gnulib offers an implementation of the fts directory hierarchy
searcher.  It is this implementation on which several parts of
coreutils rely for their 'recursive' behaviour.  One of the benefits
obtained in this way is that coreutils can handle very deeply nested
directory trees.  

I have made a CVS branch and modified findutils to use fts also.  This
was in fact less work than I had expected.  The change reduces the
size of find.c by about 1100 lines but leaves the size of the binary
approximately unchanged.  In other words the complexity burden is
shifted out of findutils and into gnulib, which already has to
maintain this code.

The findutils code on the branch always builds two binaries, one with
fts and one without.  If you do "configure --with-fts", the "find"
binary uses fts and the "oldfind" binary uses the old implementation.
If on the other hand you do "configure" without fts, then the "find"
binary uses the old algorithm and the "ftsfind" binary uses fts.  So,
even on the CVS branch the default is not (yet) to use fts.  You can
tell if the "find" binary you are looking at uses FTS, because if it
does, "find --version" will include the feature "FTS".

The fts-using implementation of find passes all the "find" test cases
in the findutils distribution, but unfortunately there are only 24
test cases.  This means that I do not, yet, have much faith in the
correctness of the conversion.

I have to hold up my hands here and confess that 24 test cases is just
a feeble effort on the automated testing front (particularly compared
to my other project, CSSC).  We do need more test cases for "find".

There are two ways in which you could test the code.

You can obtain the changed code from CVS like this:

export CVS_RSH="ssh"
cvs -z3 -d:ext:address@hidden:/cvsroot/findutils \
        co -rfts-conversion findutils

Then you need to follow the simple instructions in the README-CVS file
to compile the findutils code.  When building the code, don't forget
to say "configure --with-fts".  Otherwise you're testing the old code!

I'd like to enlist your help - yes yours - in testing this.  It's
probably the most significant change made to findutils since I became
maintainer.  I need hardly say that testing is very important indeed,
as a small mistake here could affect a large number of people (as I
recently found out when in a well-intentioned but unwise episode in
which I changed the choice of find's regexp syntax from Emacs to
posix-basic).

I've sent this email to the bug-findutils list, as its denizens have
an interest in "findutils", but also to Jim Meyering since he has an
interest in the fts implementation as well.  However, please consider
this to be an open invitation; if you think other people might be
willing to help test this significant change, please enlist their
help!

Thanks in advance for your help,
James Youngman.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]