[原文] .TH LOCATEDB 5 \" -*- nroff -*- [訳文] .TH LOCATEDB 5 ---------------------------------------- [原文] .SH NAME locatedb - front-compressed file name database . [訳文] .SH 名前 locatedb - 前置圧縮されたファイル名データベース . ---------------------------------------- [原文] .SH DESCRIPTION This manual page documents the format of file name databases for the GNU version of .BR locate . The file name databases contain lists of files that were in particular directory trees when the databases were last updated. [訳文] .SH 説明 このマニュアルページは GNU 版 locate で用いるファイル名データベースのフォーマットについて記述した ものである。ファイル名データベースには、最後に更新された時点 において、特定のディレクトリツリー下に存在していたファイルの リストが含まれている。 ---------------------------------------- [原文] .P There can be multiple databases. Users can select which databases locate searches using an environment variable or command line option; see locate(1). The system administrator can choose the file name of the default database, the frequency with which the databases are updated, and the directories for which they contain entries. Normally, file name databases are updated by running the updatedb program periodically, typically nightly; see updatedb(1). . [訳文] .P 複数のデータベースを共存させることもできる。環境変数やコマン ドラインオプションを指定すれば、ユーザーは locate に検索させるデータベースを選択することができる。詳しくは locate(1) を見よ。システム管理者はデフォルトで用いられるデータベースの 名前や、データベースの更新頻度、またデータベースに入れるディ レクトリなどを選択することができる。通常ファイル名データベー スの更新は updatedb プログラムを定期的に実行させることによって行なう(夜間が良い だろう)。詳細は updatedb(1) を見よ。 . ---------------------------------------- [原文] .SH GNU LOCATE02 database format This is the default format of databases produced by .BR updatedb . The .B updatedb program runs .B frcode to compress the list of file names using front-compression, which reduces the database size by a factor of 4 to 5. Front-compression (also known as incremental encoding) works as follows. [訳文] .SH "GNU LOCATE02 データベースフォーマット" これは updatedb により生成されるデフォルトのデータベースフォーマットである。 updatedb は frcode というプログラムを呼び出してファイル名のリストを前置圧縮 (front compression) する。これによってデータベースのサイズは 1/4 から 1/5 になる。前置圧縮 (インクリメンタルエンコーディングとも呼ばれる) は以下のような動作をする。 ---------------------------------------- [原文] .P The database entries are a sorted list (case-insensitively, for users' convenience). Since the list is sorted, each entry is likely to share a prefix (initial string) with the previous entry. Each database entry begins with an signed offset-differential count byte, which is the additional number of characters of prefix of the preceding entry to use beyond the number that the preceding entry is using of its predecessor. (The counts can be negative.) Following the count is a null-terminated ASCII remainder \(em the part of the name that follows the shared prefix. [訳文] .P データベースのエントリはソートされたリストからなっている (ユーザーの利便性のため、大文字小文字は区別していない)。従っ て、各々のエントリは直前のエントリと最初の数文字が一致してい ることが多い。それぞれのデータベースエントリには、まずオフセ ット差分カウントという 1 バイトのデータが入っている。これは現在のエントリと直前のエン トリの共有部分の文字数から、直前のエントリとそのもうひとつ前 のエントリの共有文字数を引いたものである (従ってこの数値は負になることもある)。カウントの後には共有部 分の文字列以降の残りが ASCII 文字列で与えられる。これはヌル文字で終端するとみなされる。 ---------------------------------------- [原文] .P If the offset-differential count is larger than can be stored in a signed byte (\(+-127), the byte has the value 0x80 (binary 10000000) and the actual count follows in a 2-byte word, with the high byte first (network byte order). This count can also be negative (the sign bit being in the first of the two bytes). [訳文] .P もしオフセット差分カウントがバイトデータで与えられる範囲 (\(+-127) を越えた場合は、バイトデータ 0x80 がカウントに代入され、2 バイトのワードデータがその後に続く。このワードデータでは高位 バイトが先に来る (ネットワークバイトオーダー)。This count can also be negative (the sign bit being in the first of the two bytes). ---------------------------------------- [原文] .P Every database begins with a dummy entry for a file called `LOCATE02', which locate checks for to ensure that the database file has the correct format; it ignores the entry in doing the search. [訳文] .P すべてのデータベースは、ファイルエントリの最初に `LOCATE02' というダミーのエントリを持つ。これは locate によってチェックされ、このデータベースが正しいフォーマットで あることを確認するために用いられる。実際の検索においてはこの エントリは無視される。 ---------------------------------------- [原文] .P Databases cannot be concatenated together, even if the first (dummy) entry is trimmed from all but the first database. This is because the offset-differential count in the first entry of the second and following databases will be wrong. [訳文] .P 複数のデータベースを連結することはできない。最初の (ダミー) エントリを結合するデータベースから取り去れば良さそうだが、こ れは正しくない。なぜなら後に続くデータベースの最初のエントリ におけるオフセット差分カウントは正しい値を取り得ないからであ る。 ---------------------------------------- [原文] .P In the future, the data within the locate database may not be sorted in any particular order. To obtain sorted results, pipe the output of .B locate through .BR "sort -f" . . [訳文] .P 将来的に locate データベース内のデータは、特定順での並び替えができなくなるか もしれない。並び替えを必要とする場合は、locate の出力に対してパイプにより sort -f を処理すること。 . ---------------------------------------- [原文] .SH slocate database format The .B slocate program uses a database format similar to, but not quite the same as, GNU .BR locate . The first byte of the database specifies its .I security .IR level . If the security level is 0, .B slocate will read, match and print filenames on the basis of the information in the database only. However, if the security level byte is 1, .B slocate omits entries from its output if the invoking user is unable to access them. The second byte of the database is zero. The second byte is followed by the first database entry. The first entry in the database is not preceded by any differential count or dummy entry. Instead the differential count for the first item is assumed to be zero. [訳文] .SH "slocate データベースフォーマット" slocate プログラムが利用するデータベースフォーマットは locate が利用するものと似ているが、全く同じというわけではない。デー タベースの最初のバイトは security level (セキュリティレベル) を指定している。このセキュリティレベルが 0 のときは slocate が読み込みを行い、データベース内にのみある情報に基づいて、フ ァイル名の検索と表示を行う。一方、セキュリティレベルが 1 のとき、実行ユーザのデータベースアクセスが不能である場合、sl ocate はエントリ出力を省略する。データベースの 2 番目のバイトはゼロである。3 番目のバイト以降にデータベースエントリが続く。データベースエ ントリの先頭に、差分カウントやダミーエントリが置かれることは ない。その代わりに最初の項目に対する差分カウントは、ゼロとし て取り扱われる。 ---------------------------------------- [原文] .P Starting with the second entry (if any) in the database, data is interpreted as for the GNU LOCATE02 format. . [訳文] .P 2 番目のエントリがデータベースに存在していたとすると、データは GNU LOCATE02 フォーマットと同様のものとして解釈される。 . ---------------------------------------- [原文] .SH Old Locate Database format There is also an old database format, used by Unix .B locate and .B find programs and earlier releases of the GNU ones. updatedb runs programs called bigram and code to produce old-format databases. The old format differs from the above description in the following ways. Instead of each entry starting with an offset-differential count byte and ending with a null, byte values from 0 through 28 indicate offset-differential counts from -14 through 14. The byte value indicating that a long offset-differential count follows is 0x1e (30), not 0x80. The long counts are stored in host byte order, which is not necessarily network byte order, and host integer word size, which is usually 4 bytes. They also represent a count 14 less than their value. The database lines have no termination byte; the start of the next line is indicated by its first byte having a value \(<= 30. [訳文] .SH "古い locate データベースフォーマット" Unix 版 locate および find や、以前の GNU 版で用いられていた古いデータベースフォーマットも存在している 。この古い形式のデータベースを作成する場合には、updatedb は bigram と code というプログラムを呼び出す。古いフォーマットが上に述べた記述 と異なる点を以下に示す。それぞれのエントリがオフセット差分カ ウントのバイトデータで始まりヌル文字で終わる代わりに、0 から 28 までのバイトデータが -14 から 14 までのオフセット差分カウントとして用いられ、これがエントリ区 切りを兼ねることになる。この範囲外の長いオフセット差分カウン トを示すデータには、0x80 ではなく 0x1e (30) が使われる。長いカウントを保有するデータにはホストのバイトオ ーダが用いられ (これはネットワークバイトオーダと等しいとは限らない)、またホ ストの integer のワードサイズ (4 バイトのことが多い) が用いられる。またここにストアされるデータは実際の値から 14 を引いた値になる。データベースの各エントリには終端バイトが無 く、30 以下の値を持つバイトデータが次のエントリの始まりであると認識 される。 ---------------------------------------- [原文] .P In addition, instead of starting with a dummy entry, the old database format starts with a 256 byte table containing the 128 most common bigrams 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 the high bit cleared) into the bigram table. The bigram and offset-differential count coding makes these databases 20\(en25% smaller than the new format, but makes them not 8-bit clean. Any byte in a file name that is in the ranges used for the special codes is replaced in the database by a question mark, which not coincidentally is the shell wildcard to match a single character. . [訳文] .P さらに古いデータベース形式では、ダミーエントリの代わりに先頭 に 256 バイトのテーブルがあり、ファイルリストでもっとも頻繁に用いら れている bigram が並べてある。bigram とは隣接した二つのバイトデータをインデックス付けしたものであ る。データベースに現われるバイトデータのうち、最高位ビットが セットされているものは (残りの 7 ビットをインデックスとして) bigram テーブルのデータと置換される。この bigram とオフセット差分カウントを用いることで、データベースの大きさ は新しいフォーマットより 20-25% 小さくなっている。しかし 8 ビットクリーンでないという欠点を併せ持つ。ファイル名に含まれ るバイトデータのうち、スペシャルコードに属するものは、データ ベース中ではすべてクエスチョンマークで置き換えられる。これは 任意の一文字を表わすシェルのワイルドカードなので、実際のファ イル名に現われることはない。 . ---------------------------------------- [原文] .SH EXAMPLE .nf [訳文] .SH 例 .nf ---------------------------------------- [原文] Input to frcode: /usr/src /usr/src/cmd/aardvark.c /usr/src/cmd/armadillo.c /usr/tmp/zoo [訳文] frcode への入力が以下のようなものとする: /usr/src /usr/src/cmd/aardvark.c /usr/src/cmd/armadillo.c /usr/tmp/zoo ---------------------------------------- [原文] Length of the longest prefix of the preceding entry to share: 0 /usr/src 8 /cmd/aardvark.c 14 rmadillo.c 5 tmp/zoo [訳文] 直前のエントリとの最長一致部分の長さは: 0 /usr/src 8 /cmd/aardvark.c 14 rmadillo.c 5 tmp/zoo ---------------------------------------- [原文] .fi Output from frcode, with trailing nulls changed to newlines and count bytes made printable: .nf 0 LOCATE02 0 /usr/src 8 /cmd/aardvark.c 6 rmadillo.c -9 tmp/zoo [訳文] .fi frcode からの出力は、最後のヌル文字を改行に代え、カウントバイトを数 字に代えると以下のようなものになる: .nf 0 LOCATE02 0 /usr/src 8 /cmd/aardvark.c 6 rmadillo.c -9 tmp/zoo ---------------------------------------- [原文] (6 = 14 - 8, and -9 = 5 - 14) .fi . [訳文] (6 = 14 - 8 または -9 = 5 - 14) .fi . ---------------------------------------- [原文] .SH "REPORTING BUGS" GNU findutils online help: Report any translation bugs to [訳文] .SH バグ報告 GNU findutils オンラインヘルプ: 翻訳に関するバグ報告: ---------------------------------------- [原文] .PP Report any other issue via the form at the GNU Savannah bug tracker: [訳文] .PP その他の問題について GNU Savannah バグトラッカー経由での報告: ---------------------------------------- [原文] .RS [訳文] .RS ---------------------------------------- [原文] .RE General topics about the GNU findutils package are discussed at the .I bug-findutils mailing list: [訳文] .RE GNU findutils パッケージのメーリングリスト bug-findutils において議論されている全般的なトピック: ---------------------------------------- [原文] .RS [訳文] .RS ---------------------------------------- [原文] .RE . [訳文] .RE . ---------------------------------------- [原文] .SH COPYRIGHT Copyright © 1994-2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. . [訳文] .SH 著作権 Copyright © 1994-2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. . ---------------------------------------- [原文] .SH "SEE ALSO" .BR find (1), .BR locate (1), .BR xargs (1), .BR locatedb (5) [訳文] .SH 関連項目 find(1), locate(1), xargs(1), locatedb(5) ---------------------------------------- [原文] .PP Full documentation or available locally via: .B info locatedb [訳文] .PP 充実したドキュメントは を参照のこと。 またローカルにおいては info locatedb により参照可。 ----------------------------------------