From owner-freebsd-commit Tue Mar 5 16:42:44 1996 Return-Path: owner-commit Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id QAA11338 for freebsd-commit-outgoing; Tue, 5 Mar 1996 16:42:44 -0800 (PST) Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id QAA11316 for cvs-all-outgoing; Tue, 5 Mar 1996 16:42:36 -0800 (PST) Received: from mail.cs.tu-berlin.de (root@mail.cs.tu-berlin.de [130.149.17.13]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id QAA11285 Tue, 5 Mar 1996 16:42:25 -0800 (PST) Received: from caramba.cs.tu-berlin.de (wosch@caramba.cs.tu-berlin.de [130.149.17.12]) by mail.cs.tu-berlin.de (8.6.12/8.6.12) with ESMTP id BAA29383; Wed, 6 Mar 1996 01:33:52 +0100 Received: (from wosch@localhost) by campa.panke.de (8.6.9/8.6.9) id VAA00603; Tue, 5 Mar 1996 21:45:32 +0100 Date: Tue, 5 Mar 1996 21:45:32 +0100 From: Wolfram Schneider Message-Id: <199603052045.VAA00603@campa.panke.de> To: Bruce Evans Cc: CVS-committers@freefall.freebsd.org, cvs-all@freefall.freebsd.org, cvs-usrbin@freefall.freebsd.org, davidg@freefall.freebsd.org, wosch@cs.tu-berlin.de Subject: Re: cvs commit: src/usr.bin/locate/locate updatedb.csh updatedb.sh In-Reply-To: <199603051337.AAA06109@godzilla.zeta.org.au> References: <199603051337.AAA06109@godzilla.zeta.org.au> Reply-to: Wolfram Schneider MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-commit@FreeBSD.ORG Precedence: bulk >gnu locate supports multiple databases (specified in the environment >variable LOCATE_PATH IIRC). This allows the cdrom databases to be >kept separately and merged when locate is run. I changed my FreeBSD locate to support multiple databases (option or environment). I fixed also broken locate.bigram and locate.code. It works well but I don't think my code style is ready for a commit. Wolfram New options -S Print some statistic about database and exit. -c Suppress normal output; instead print a count of matching file names. -d database Search in database instead the default file name database. Multiple option -d allowed and use different databases Or in other words, the last -d don't overwrite the pre- vious -d database may be a colon-separated list of databases. A single colon is a reference to the default database. $ locate -d ~/lib/mydb: foo search first in ~/lib/mydb and then in /var/db/locate.database. Read from standard input if file name - is given. For example, you can compress your database and use: $ zcat database.gz | locate -d - pattern This maybe useful on machines with fast CPU and few RAM and slow I/O. Note: you can only use *one* pattern for stdin. -i Ignore case distinctions in both the pattern and the database. -l number Limit output to number of file names and exit. -m use mmap(2) instead stdio library, default. In most cases faster. -s use stdio library instead mmap(2).