home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / man / cat5 / locatedb.5 next >
Text File  |  1994-12-22  |  6KB  |  133 lines

  1.  
  2.  
  3.  
  4. LOCATEDB(5L)                                         LOCATEDB(5L)
  5.  
  6.  
  7. NNAAMMEE
  8.        locatedb - front-compressed file name database
  9.  
  10. DDEESSCCRRIIPPTTIIOONN
  11.        This  manual  page  documents  the  format  of  file  name
  12.        databases for the GNU version of llooccaattee.   The  file  name
  13.        databases  contain  lists of files that were in particular
  14.        directory trees when the databases were last updated.
  15.  
  16.        There can be multiple databases.  Users can  select  which
  17.        databases llooccaattee searches using an environment variable or
  18.        command line option; see llooccaattee(1L).  The system  adminis-
  19.        trator  can  choose the file name of the default database,
  20.        the frequency with which the databases  are  updated,  and
  21.        the directories for which they contain entries.  Normally,
  22.        file name databases are updated by  running  the  uuppddaatteeddbb
  23.        program periodically, typically nightly; see uuppddaatteeddbb(1L).
  24.  
  25.        uuppddaatteeddbb runs a program called ffrrccooddee to compress the list
  26.        of  file  names using front-compression, which reduces the
  27.        database size by a factor of 4  to  5.   Front-compression
  28.        (also known as incremental encoding) works as follows.
  29.  
  30.        The   database   entries   are   a   sorted   list  (case-
  31.        insensitively, for users' convenience).  Since the list is
  32.        sorted,  each  entry  is likely to share a prefix (initial
  33.        string) with the  previous  entry.   Each  database  entry
  34.        begins  with  an  offset-differential count byte, which is
  35.        the additional number of characters of prefix of the  pre-
  36.        ceding  entry  to use beyond the number that the preceding
  37.        entry is using of its predecessor.   (The  counts  can  be
  38.        negative.)  Following the count is a null-terminated ASCII
  39.        remainder -- the part of the name that follows the  shared
  40.        prefix.
  41.  
  42.        If  the  offset-differential  count  is larger than can be
  43.        stored in a byte (+/-127), the byte has the value 0x80 and
  44.        the  count  follows  in  a 2-byte word, with the high byte
  45.        first (network byte order).
  46.  
  47.        Every database begins with a dummy entry for a file called
  48.        `LOCATE02',  which  llooccaattee  checks  for to ensure that the
  49.        database file has the correct format; it ignores the entry
  50.        in doing the search.
  51.  
  52.        Databases  can  not  be concatenated together, even if the
  53.        first (dummy) entry is trimmed  from  all  but  the  first
  54.        database.   This  is because the offset-differential count
  55.        in the first entry of the second and  following  databases
  56.        will be wrong.
  57.  
  58.        There  is also an old database format, used by Unix llooccaattee
  59.        and ffiinndd programs and earlier releases of  the  GNU  ones.
  60.        uuppddaatteeddbb  runs  programs called bbiiggrraamm and ccooddee to produce
  61.  
  62.  
  63.  
  64.                                                                 1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. LOCATEDB(5L)                                         LOCATEDB(5L)
  71.  
  72.  
  73.        old-format databases.  The old  format  differs  from  the
  74.        above  description in the following ways.  Instead of each
  75.        entry starting with an offset-differential count byte  and
  76.        ending with a null, byte values from 0 through 28 indicate
  77.        offset-differential counts from -14 through 14.  The  byte
  78.        value  indicating  that  a  long offset-differential count
  79.        follows is 0x1e (30),  not  0x80.   The  long  counts  are
  80.        stored  in  host byte order, which is not necessarily net-
  81.        work byte order, and host integer word size, which is usu-
  82.        ally  4  bytes.   They also represent a count 14 less than
  83.        their value.  The database lines have no termination byte;
  84.        the  start of the next line is indicated by its first byte
  85.        having a value <= 30.
  86.  
  87.        In addition, instead of starting with a dummy  entry,  the
  88.        old  database format starts with a 256 byte table contain-
  89.        ing the 128 most common  bigrams  in  the  file  list.   A
  90.        bigram is a pair of adjacent bytes.  Bytes in the database
  91.        that have the high bit set are indexes (with the high  bit
  92.        cleared)  into  the  bigram table.  The bigram and offset-
  93.        differential count coding  makes  these  databases  20-25%
  94.        smaller  than  the  new  format,  but makes them not 8-bit
  95.        clean.  Any byte in a file name that is in the ranges used
  96.        for  the  special  codes  is replaced in the database by a
  97.        question mark, which not coincidentally is the shell wild-
  98.        card to match a single character.
  99.  
  100. EEXXAAMMPPLLEE
  101.        Input to ffrrccooddee:
  102.        /usr/src
  103.        /usr/src/cmd/aardvark.c
  104.        /usr/src/cmd/armadillo.c
  105.        /usr/tmp/zoo
  106.  
  107.        Length of the longest prefix of the preceding entry to share:
  108.        0 /usr/src
  109.        8 /cmd/aardvark.c
  110.        14 rmadillo.c
  111.        5 tmp/zoo
  112.  
  113.        Output  from  ffrrccooddee,  with trailing nulls changed to new-
  114.        lines and count bytes made printable:
  115.        0 LOCATE02
  116.        0 /usr/src
  117.        8 /cmd/aardvark.c
  118.        6 rmadillo.c
  119.        -9 tmp/zoo
  120.  
  121.        (6 = 14 - 8, and -9 = 5 - 14)
  122.  
  123. SSEEEE AALLSSOO
  124.        ffiinndd(1L),  llooccaattee(1L),  llooccaatteeddbb(5L),  xxaarrggss(1L)   FFiinnddiinngg
  125.        FFiilleess (on-line in Info, or printed)
  126.  
  127.  
  128.  
  129.  
  130.                                                                 2
  131.  
  132.  
  133.