bug-findutils
[Top][All Lists]
Advanced

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

Re: "insert" or "remove" a filename from locatedb


From: James Youngman
Subject: Re: "insert" or "remove" a filename from locatedb
Date: Tue, 30 Jul 2013 17:58:01 +0100

On Tue, Jul 30, 2013 at 4:22 PM, Gary Hassani <address@hidden> wrote:
>
>
> Anyone of a way (program) that will 'insert' or 'delete' a file from a
> locatedb?

locate won't support in-place modification of its database.  But you
can re-write it.   For example, you can dump al the entries in the
database with

locate --null --regex ""

And then edit the resulting stream of (NUL-terminated) paths to omit
any items you want to delete.   You then feed the stream to frcode to
generate a new database.  See the updatedb shell script for details.
Adding files would be similar, though for that case you also need to
ensure that the file list is sorted.

James.

>
>
>
> In other words. given a locatedb and a filename is it possible to insert
> that filename into the locatedb?

In general there may not be a "the" locatedb since multiple databases
are supported.

>
>
>
> Similarly given a locatedb and a filename is it possible to remove that
> filename from the locatedb ?
>
> Thanks very much.
>
>
>



-- 
--
This email is intended solely for the use of its addressee, sender,
and any readers of a mailing list archive in which it happens to
appear.   If you have received this email in error, please say or type
three times, "I believe in the utility of email disclaimers," and then
reply to the author correcting any spellings (and, optionally, any
incorrect spellings), accompanying these with humorous jests about the
author's parentage.   If you are not the addressee, you are
nevertheless permitted to both copy and forward this email since
without such permissions email systems are unable to transmit email to
anybody, intended recipient or not.  To those still reading by this
point, the author would like to apologise for being unable to maintain
a consistent level of humour throughout this disclaimer.  Contents may
settle during transit.  Do not feed the animals.



reply via email to

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