bug-findutils
[Top][All Lists]
Advanced

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

Re: debugging --findoptions (Possible bug fix) updatedb (GNU findutils)


From: Dale R. Worley
Subject: Re: debugging --findoptions (Possible bug fix) updatedb (GNU findutils) 4.6.0
Date: Tue, 17 Jan 2017 15:27:26 -0500

Freeman Mayberry <address@hidden> writes:
> So updatedb was taking too long, as in never finishing, I decided to try
> and find out why. However when I entered (after much googling):
>
> nice -n -19 updatedb --findoptions="-D stat"
>
> it kept telling me the option was not found.
>
>
> In file C:\cygwin64\bin\updatedb I moved $FINDOPTIONS to
> before $SEARCHPATHS in all the lines it occurs.
>
>     "$find $FINDOPTIONS $SEARCHPATHS \
>
> now it seems to work flawlessly. Even after I took out
> the --prunepaths='/cygdrive' because it was looping on the drives in it. It
> finished before I finished this email.

This is nasty...  There are some options to "find" which must be given
*before* the search paths.  "-D" is one of those options.  There are
some "options" to "find" which must be given *after* the search paths,
in that they appear among the file-selecting predicates, though they
always return true their presence modifies how file selection is done.
(See the first subsection "Options" in the find manual page.)

It looks like --findoptions was designed for the *second* type of
options, whereas you want to use it for the *first* type of options.

To do this right, we may need to introduce a new option to updatedb.

OTOH, there doesn't seem to be any intrinsic reason why the second type
of option couldn't be placed before the path names, or (assuming
processing was done in the right order) the first type of option
couldn't be placed after the path names.  That is, make these legal:

    find -depth A B C -type f

    find A B C -D stat -type f

Dale




reply via email to

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