bug-findutils
[Top][All Lists]
Advanced

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

Re: Feature Request: unify find/locate interface


From: James Youngman
Subject: Re: Feature Request: unify find/locate interface
Date: Thu, 23 Jun 2005 06:20:27 +0100
User-agent: Mutt/1.3.28i

On Wed, Jun 22, 2005 at 01:45:14PM -0600, Nathan wrote:
> Hello,
> 
> It seems like it'd be a simple and useful feature to add an option to
> "find" which would instruct it to use the updatedb database, instead
> of searching the filesystem.

This is terribly non-trivial, as it would for example be very
difficult to implement -depth.


> The advantage is that new comers would no longer have to learn the
> commandline for both find and locate, and the expressive power of find
> is preferable to locate, IMO.

Similarly, the simplicity of locate is preferable to find.  It depends
how you look at it.

> I imagine the hardest part would be to incorporate more meta-info into
> the locatedb so as to allow it to handle find's breadth of options.

Yes, principally ensuring that the saved "struct stat" items are
stably sorted with the filenames (you would also need a new locate
database format, but that is trivial).

> Also, there may be problems with find actions other than -print (such
> as -exec) because the file existence or metainfo may have changed
> since the last updatedb run...

This issue is less problematic than you think - this can happen now in
real-time anyway.

> Has anyone discussed this kind of unification before?  Is it harder
> than I imagine?  Is this the wrong medium for wishlist items?

istorically, "find foo" used to do what "locate foo" now does.  See
the various bits of documentation in the findutils sources about the
original Usenix/:login paper.

This is the right medium for wishlist items, but wishoist items go a
lot further if they are patches.  Wishlist items without patches
generally only go somewhere if they are very easy to implement.  If
you want the feature, the best way forward is to propose code pactehes
or convince someone else that it's worth writing this code and
submitting a patch.

Regards,
James




reply via email to

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