SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG

BotDetect - Real-Time Bot Detection API
 
 

MAN page from Old RedHat 5.X findutils-4.1-24.i386.rpm

LOCATEDB

Section: Misc. Reference Manual Pages (5L)
Index 

NAME

locatedb - front-compressed file name database 

DESCRIPTION

This manual page documents the format of file name databases for theGNU version oflocate.The file name databases contain lists of files that were inparticular directory trees when the databases were last updated.There can be multiple databases. Users can select which databaseslocate searches using an environment variable or command lineoption; see locate(1L). The system administrator can choose thefile name of the default database, the frequency with which thedatabases are updated, and the directories for which they containentries. Normally, file name databases are updated by running theupdatedb program periodically, typically nightly; seeupdatedb(1L).updatedb runs a program called frcode to compress the listof file names using front-compression, which reducesthe database size by a factor of 4 to 5. Front-compression (alsoknown as incremental encoding) works as follows.The database entries are a sorted list (case-insensitively, for users'convenience). Since the list is sorted, each entry is likely to sharea prefix (initial string) with the previous entry. Each databaseentry begins with an offset-differential count byte, which is theadditional number of characters of prefix of the preceding entry touse beyond the number that the preceding entry is using of itspredecessor. (The counts can be negative.) Following the count is anull-terminated ASCII remainder --- the part of the name that followsthe shared prefix.If the offset-differential count is larger than can be stored in abyte (+/-127), the byte has the value 0x80 and the count follows in a2-byte word, with the high byte first (network byte order).Every database begins with a dummy entry for a file called `LOCATE02',which locate checks for to ensure that the database file has thecorrect format; it ignores the entry in doing the search.Databases can not be concatenated together, even if the first(dummy) entry is trimmed from all but the first database. Thisis because the offset-differential count in the first entry of thesecond and following databases will be wrong.There is also an old database format, used by Unixlocateandfindprograms and earlier releases of the GNU ones. updatedb runsprograms called bigram and code to produce old-formatdatabases. The old format differs from the above description in thefollowing ways. Instead of each entry starting with anoffset-differential count byte and ending with a null, byte valuesfrom 0 through 28 indicate offset-differential counts from -14 through14. The byte value indicating that a long offset-differential countfollows is 0x1e (30), not 0x80. The long counts are stored in hostbyte order, which is not necessarily network byte order, and hostinteger word size, which is usually 4 bytes. They also represent acount 14 less than their value. The database lines have notermination byte; the start of the next line is indicated by its firstbyte having a value <= 30.In addition, instead of starting with a dummy entry, the old databaseformat starts with a 256 byte table containing the 128 most commonbigrams in the file list. A bigram is a pair of adjacent bytes.Bytes in the database that have the high bit set are indexes (with thehigh bit cleared) into the bigram table. The bigram andoffset-differential count coding makes these databases 20-25% smallerthan the new format, but makes them not 8-bit clean. Any byte in afile name that is in the ranges used for the special codes is replacedin the database by a question mark, which not coincidentally is theshell wildcard to match a single character. 

EXAMPLE

Input to frcode:/usr/src/usr/src/cmd/aardvark.c/usr/src/cmd/armadillo.c/usr/tmp/zooLength of the longest prefix of the preceding entry to share:0 /usr/src8 /cmd/aardvark.c14 rmadillo.c5 tmp/zoo
Output from frcode, with trailing nulls changed to newlinesand count bytes made printable:
0 LOCATE020 /usr/src8 /cmd/aardvark.c6 rmadillo.c-9 tmp/zoo(6 = 14 - 8, and -9 = 5 - 14)
 

SEE ALSO

find(1L), locate(1L), locatedb(5L), xargs(1L)Finding Files (on-line in Info, or printed)


 

Index

NAME
DESCRIPTION
EXAMPLE
SEE ALSO

This document was created byman2html,using the manual pages.
 
ICM Bot detect detector