OSDN Git Service

Merge branch 'work-coreutils'
[linuxjm/jm.git] / manual / bzip2 / draft / man1 / bzip2.1
1 .\"
2 .\" Japanese Version Copyright (c) 2000-2003 Yuichi SATO
3 .\"         all rights reserved.
4 .\" Translated Wed Dec 20 19:01:03 JST 2000
5 .\"         by Yuichi SATO <sato@complex.eng.hokudai.ac.jp>
6 .\" Updated & Modified Tue Apr 29 20:36:04 JST 2003
7 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
8 .\"
9 .\"WORD:        compress        圧縮
10 .\"WORD:        decompress      伸長
11 .\"
12 .PU
13 .TH bzip2 1
14 .\"O .SH NAME
15 .SH 名前
16 .\"O bzip2, bunzip2 \- a block-sorting file compressor, v1.0.2
17 bzip2, bunzip2 \- ブロックソートによってファイルを圧縮・伸長する。バージョン 1.0.2
18 .br
19 .\"O bzcat \- decompresses files to stdout
20 bzcat \- ファイルを標準出力に伸長する
21 .br
22 .\"O bzip2recover \- recovers data from damaged bzip2 files
23 bzip2recover \- 破損した bzip2 ファイルからデータを復元する
24
25 .\"O .SH SYNOPSIS
26 .SH 書式
27 .ll +8
28 .B bzip2
29 .RB [ " \-cdfkqstvzVL123456789 " ]
30 [
31 .I "filenames \&..."
32 ]
33 .ll -8
34 .br
35 .B bunzip2
36 .RB [ " \-fkvsVL " ]
37
38 .I "filenames \&..."
39 ]
40 .br
41 .B bzcat
42 .RB [ " \-s " ]
43
44 .I "filenames \&..."
45 ]
46 .br
47 .B bzip2recover
48 .I "filename"
49
50 .\"O .SH DESCRIPTION
51 .SH 説明
52 .\"O .I bzip2
53 .\"O compresses files using the Burrows-Wheeler block sorting
54 .\"O text compression algorithm, and Huffman coding.  Compression is
55 .\"O generally considerably better than that achieved by more conventional
56 .\"O LZ77/LZ78-based compressors, and approaches the performance of the PPM
57 .\"O family of statistical compressors.
58 .I bzip2
59 は、Burrows-Wheeler ブロックソートテキスト圧縮アルゴリズムと
60 Huffman コード化を使ってファイルを圧縮する。
61 圧縮率は、一般的な LZ77/LZ78 ベースの圧縮率に比べると、大抵の場合でとても良い。
62 また、圧縮速度は、統計的圧縮法である PPM 圧縮の速度に近づいている。
63
64 .\"O The command-line options are deliberately very similar to 
65 .\"O those of 
66 .\"O .I GNU gzip, 
67 .\"O but they are not identical.
68 コマンドラインオプションは
69 .I GNU gzip
70 のオプションにわざと似せてあるが、同じではない。
71
72 .\"O .I bzip2
73 .\"O expects a list of file names to accompany the
74 .\"O command-line flags.  Each file is replaced by a compressed version of
75 .\"O itself, with the name "original_name.bz2".  
76 .\"O Each compressed file
77 .\"O has the same modification date, permissions, and, when possible,
78 .\"O ownership as the corresponding original, so that these properties can
79 .\"O be correctly restored at decompression time.  File name handling is
80 .\"O naive in the sense that there is no mechanism for preserving original
81 .\"O file names, permissions, ownerships or dates in filesystems which lack
82 .\"O these concepts, or have serious file name length restrictions, such as
83 .\"O MS-DOS.
84 .I bzip2
85 はコマンドラインのフラグを伴ったファイル名のリストを受け取る。
86 各ファイルは、"original_name.bz2" という名前の
87 圧縮されたファイルに置き換えられる。
88 圧縮ファイルの修正日・アクセス権・(設定可能な場合の) 所有者は、
89 元のファイルと同じになる。
90 これにより、伸長時に属性が正しく復元される。
91 ファイル名の操作は、
92 元のファイル名・アクセス権・所有者を保存する仕組みが
93 ファイルシステムになかったり、
94 MS-DOS のように深刻なファイル名の長さ制限があるために、
95 とても面倒である。
96
97 .\"O .I bzip2
98 .\"O and
99 .\"O .I bunzip2
100 .\"O will by default not overwrite existing
101 .\"O files.  If you want this to happen, specify the \-f flag.
102 .I bzip2
103
104 .I bunzip2
105 はデフォルトでは既存のファイルを上書きしない。
106 上書きしたい場合は \-f フラグを指定すること。
107
108 .\"O If no file names are specified,
109 .\"O .I bzip2
110 .\"O compresses from standard
111 .\"O input to standard output.  In this case,
112 .\"O .I bzip2
113 .\"O will decline to
114 .\"O write compressed output to a terminal, as this would be entirely
115 .\"O incomprehensible and therefore pointless.
116 ファイル名が指定されない場合、
117 .I bzip2
118 標準入力を圧縮して標準出力に書き出す。
119 この場合、
120 .I bzip2
121 は圧縮された出力を端末には書き出さない。
122 なぜなら、この出力は全く分かりにくくて、無駄なものだからである。
123
124 .\"O .I bunzip2
125 .\"O (or
126 .\"O .I bzip2 \-d) 
127 .\"O decompresses all
128 .\"O specified files.  Files which were not created by 
129 .\"O .I bzip2
130 .\"O will be detected and ignored, and a warning issued.  
131 .\"O .I bzip2
132 .\"O attempts to guess the filename for the decompressed file 
133 .\"O from that of the compressed file as follows:
134 .I bunzip2
135 (または
136 .IR "bzip2 \-d" ) 
137 は、指定された全てのファイルを伸長する。
138 .I bzip2
139 で圧縮されていないファイルは検知され、無視される。
140 さらに警告が出される。
141 .I bzip2
142 は、以下のようにして圧縮ファイルの名前から伸長後のファイル名を推測する。
143
144 .\"O        filename.bz2    becomes   filename
145 .\"O        filename.bz     becomes   filename
146 .\"O        filename.tbz2   becomes   filename.tar
147 .\"O        filename.tbz    becomes   filename.tar
148 .\"O        anyothername    becomes   anyothername.out
149        filename.bz2    は   filename         になる。
150        filename.bz     は   filename         になる。
151        filename.tbz2   は   filename.tar     になる。
152        filename.tbz    は   filename.tar     になる。
153        anyothername    は   anyothername.out になる。
154
155 .\"O If the file does not end in one of the recognised endings, 
156 .\"O .I .bz2, 
157 .\"O .I .bz, 
158 .\"O .I .tbz2
159 .\"O or
160 .\"O .I .tbz, 
161 .\"O .I bzip2 
162 .\"O complains that it cannot
163 .\"O guess the name of the original file, and uses the original name
164 .\"O with
165 .\"O .I .out
166 .\"O appended.
167 ファイル名が
168 .IR .bz2 , 
169 .IR .bz , 
170 .IR .tbz2 ,
171 .I .tbz
172 のような認識される拡張子のいずれかで終っていない場合、
173 .I bzip2
174 は元のファイル名が推測できないという警告を出し、
175 .I .out
176 を付加した名前を元のファイル名として使う。
177
178 .\"O As with compression, supplying no
179 .\"O filenames causes decompression from 
180 .\"O standard input to standard output.
181 圧縮の場合と同様に、
182 ファイル名が指定されない場合は、
183 標準入力を伸長して標準出力に書き出す。
184
185 .\"O .I bunzip2 
186 .\"O will correctly decompress a file which is the
187 .\"O concatenation of two or more compressed files.  The result is the
188 .\"O concatenation of the corresponding uncompressed files.  Integrity
189 .\"O testing (\-t) 
190 .\"O of concatenated 
191 .\"O compressed files is also supported.
192 .I bunzip2 
193 は 2 つ以上の圧縮ファイルを連結したファイルでも正しく伸長する。
194 伸長して得られるファイルは、圧縮前のファイルを連結したものになる。
195 連結した圧縮ファイルの完全性テスト (\-t) もサポートされている。
196
197 .\"O You can also compress or decompress files to the standard output by
198 .\"O giving the \-c flag.  Multiple files may be compressed and
199 .\"O decompressed like this.  The resulting outputs are fed sequentially to
200 .\"O stdout.  Compression of multiple files 
201 .\"O in this manner generates a stream
202 .\"O containing multiple compressed file representations.  Such a stream
203 .\"O can be decompressed correctly only by
204 .\"O .I bzip2 
205 .\"O version 0.9.0 or
206 .\"O later.  Earlier versions of
207 .\"O .I bzip2
208 .\"O will stop after decompressing
209 .\"O the first file in the stream.
210 \-c フラグを指定することにより、
211 圧縮・伸長されたファイルを標準出力に書き出すこともできる。
212 このフラグを指定して、複数のファイルを圧縮・伸長することができる。
213 結果の出力は標準出力に順番に書き出される。
214 この方式による複数ファイルの圧縮では、
215 複数圧縮ファイル表現を含むストリームが生成される。
216 このようなストリームは、
217 バージョン 0.9.0 以降の
218 .I bzip2 
219 でしか正しく伸長できない。
220 これより前のバージョンの
221 .I bzip2
222 ではストリーム中の最初のファイルを伸長した後に停止する。
223
224 .\"O .I bzcat
225 .\"O (or
226 .\"O .I bzip2 -dc) 
227 .\"O decompresses all specified files to
228 .\"O the standard output.
229 .I bzcat
230 (または
231 .IR "bzip2 -dc" ) 
232 は指定した全てのファイルを伸長し、標準出力に書き出す。
233
234 .\"O .I bzip2
235 .\"O will read arguments from the environment variables
236 .\"O .I BZIP2
237 .\"O and
238 .\"O .I BZIP,
239 .\"O in that order, and will process them
240 .\"O before any arguments read from the command line.  This gives a 
241 .\"O convenient way to supply default arguments.
242 .I bzip2
243 は環境変数
244 .IR BZIP2 ,
245 .I BZIP
246 からこの順番で引き数を読み込み、
247 コマンドラインから読み込まれた引き数よりも先に処理する。
248 これはデフォルトの引き数を与える便利な方法である。
249
250 .\"O Compression is always performed, even if the compressed 
251 .\"O file is slightly
252 .\"O larger than the original.  Files of less than about one hundred bytes
253 .\"O tend to get larger, since the compression mechanism has a constant
254 .\"O overhead in the region of 50 bytes.  Random data (including the output
255 .\"O of most file compressors) is coded at about 8.05 bits per byte, giving
256 .\"O an expansion of around 0.5%.
257 圧縮後のファイルが元のファイルより少し大きくなる場合であっても、
258 圧縮は常に行われる。
259 100 バイトより小さいぐらいのファイルは、圧縮によって大きくなる傾向がある。
260 なぜなら、この圧縮メカニズムが
261 定常的に 50 バイトのオーバーヘッドを持つためである。
262 (大部分のファイル圧縮法による出力を含む) ランダムなデータは、
263 1 バイト当たり約 8.05 ビットでコード化され、約 0.5% 大きくなる。
264
265 .\"O As a self-check for your protection, 
266 .\"O .I 
267 .\"O bzip2
268 .\"O uses 32-bit CRCs to
269 .\"O make sure that the decompressed version of a file is identical to the
270 .\"O original.  This guards against corruption of the compressed data, and
271 .\"O against undetected bugs in
272 .\"O .I bzip2
273 .\"O (hopefully very unlikely).  The
274 .\"O chances of data corruption going undetected is microscopic, about one
275 .\"O chance in four billion for each file processed.  Be aware, though, that
276 .\"O the check occurs upon decompression, so it can only tell you that
277 .\"O something is wrong.  It can't help you 
278 .\"O recover the original uncompressed
279 .\"O data.  You can use 
280 .\"O .I bzip2recover
281 .\"O to try to recover data from
282 .\"O damaged files.
283 データ保護のための自己チェックとして、
284 .I bzip2
285 は 32 ビット CRC を破損したファイルを元のファイルと同じにするために使う。
286 これにより、圧縮データの破損とまだ見つかっていない
287 .I bzip2
288 のバグ (とても少ないことを期待する) からデータを保護することができる。
289 データの破損が検知されない確率は非常に少なく、
290 各ファイル処理につき 40 億回に 1 回程度である。
291 しかし、このチェックは伸長のときにしか行われないので、
292 何か間違いがあることを知らせるだけである点に注意すること。
293 オリジナルの圧縮されていないデータを復元する助けにはならない。
294 破損したファイルからデータを復元するためには、
295 .I bzip2recover
296 を使うことができる。
297
298 .\"O Return values: 0 for a normal exit, 1 for environmental problems (file
299 .\"O not found, invalid flags, I/O errors, &c), 2 to indicate a corrupt
300 .\"O compressed file, 3 for an internal consistency error (eg, bug) which
301 .\"O caused
302 .\"O .I bzip2
303 .\"O to panic.
304 返り値:
305 正常終了の場合、0 が返される。
306 実行環境の問題 (ファイルがない・不正なフラグ・
307 I/O エラーなど) がある場合、1 が返される。
308 破損した圧縮ファイルの場合、2 が返される。
309 .I bzip2
310 にパニックを引き起こす内部整合性エラー (例えば、バグ) の場合、3 が返される。
311
312 .\"O .SH OPTIONS
313 .SH オプション
314 .TP
315 .B \-c --stdout
316 .\"O Compress or decompress to standard output.
317 圧縮・伸長した結果を標準出力に書き出す。
318 .TP
319 .\"O .B \-d --decompress
320 .\"O Force decompression.  
321 .\"O .I bzip2, 
322 .\"O .I bunzip2 
323 .\"O and
324 .\"O .I bzcat 
325 .\"O are
326 .\"O really the same program, and the decision about what actions to take is
327 .\"O done on the basis of which name is used.  This flag overrides that
328 .\"O mechanism, and forces 
329 .\"O .I bzip2
330 .\"O to decompress.
331 .B \-d --decompress
332 ファイルの伸長をさせる。
333 .IR bzip2 , 
334 .IR bunzip2 ,
335 .I bzcat 
336 は実際には同じプログラムである。
337 どの動作をするのかは、どの名前が使われたかに基づいて決められる。
338 このフラグは、その動作決定機構より優先され、
339 .I bzip2
340 にファイルの伸長をさせる。
341 .TP
342 .B \-z --compress
343 .\"O The complement to \-d: forces compression, regardless of the
344 .\"O invocation name.
345 \-d の反対。
346 起動された名前にかかわらず、ファイルの圧縮をさせる。
347 .TP
348 .B \-t --test
349 .\"O Check integrity of the specified file(s), but don't decompress them.
350 .\"O This really performs a trial decompression and throws away the result.
351 指定されたファイルの完全性のチェックをするが、伸長はしない。
352 伸長テストを行い、結果を破棄する。
353 .TP
354 .B \-f --force
355 .\"O Force overwrite of output files.  Normally,
356 .\"O .I bzip2 
357 .\"O will not overwrite
358 .\"O existing output files.  Also forces 
359 .\"O .I bzip2 
360 .\"O to break hard links
361 .\"O to files, which it otherwise wouldn't do.
362 出力ファイルの上書きをさせる。
363 通常、
364 .I bzip2 
365 は既存の出力ファイルを上書きしない。
366 さらに
367 .I bzip2 
368 にファイルへのハードリンクを削除させる。
369 このオプションが指定されていない場合は、ハードリンクの削除もされない。
370
371 .\"O bzip2 normally declines to decompress files which don't have the
372 .\"O correct magic header bytes.  If forced (-f), however, it will pass
373 .\"O such files through unmodified.  This is how GNU gzip behaves.
374 通常 bzip2 は正しいマジックヘッダバイトを持たないファイルを伸長しない。
375 ただし (-f) で強制すれば、これらのファイルも修正せずに通過させる。
376 これは GNU gzip の動作と同じである。
377 .TP
378 .B \-k --keep
379 .\"O Keep (don't delete) input files during compression
380 .\"O or decompression.
381 伸長・展開の後でも入力ファイルを保存する (削除しない)。
382 .TP
383 .B \-s --small
384 .\"O Reduce memory usage, for compression, decompression and testing.  Files
385 .\"O are decompressed and tested using a modified algorithm which only
386 .\"O requires 2.5 bytes per block byte.  This means any file can be
387 .\"O decompressed in 2300k of memory, albeit at about half the normal speed.
388 圧縮・伸長・テストの際のメモリ使用量を減らす。
389 1 ブロックバイト当たり 2.5 バイトしか必要としない
390 修正されたアルゴリズムを使って、
391 ファイルの伸長・テストが行われる。
392 全てのファイルが 2300kB のメモリで伸長できるが、
393 通常の速度の約半分の速度になってしまう。
394
395 .\"O During compression, \-s selects a block size of 200k, which limits
396 .\"O memory use to around the same figure, at the expense of your compression
397 .\"O ratio.  In short, if your machine is low on memory (8 megabytes or
398 .\"O less), use \-s for everything.  See MEMORY MANAGEMENT below.
399 圧縮の場合、\-s フラグを使うと 200kB のブロックサイズが選択される。
400 メモリ使用量はこれと同じくらいになるが、圧縮率が犠牲になる。
401 つまり、計算機にメモリが少ない (8 MB 以下) 場合は、
402 全てのファイルについて \-s フラグを使うこと。
403 以下の「メモリ管理」セクションを参照すること。
404 .TP
405 .B \-q --quiet
406 .\"O Suppress non-essential warning messages.  Messages pertaining to
407 .\"O I/O errors and other critical events will not be suppressed.
408 本質的でない警告メッセージを抑制する。
409 I/O エラーと致命的なイベントに関係するメッセージは抑制されない。
410 .TP
411 .B \-v --verbose
412 .\"O Verbose mode -- show the compression ratio for each file processed.
413 .\"O Further \-v's increase the verbosity level, spewing out lots of
414 .\"O information which is primarily of interest for diagnostic purposes.
415 詳細表示モード -- 各ファイル処理について圧縮率を表示する。
416 さらに \-v の数を増やすと、詳細表示のレベルも上がり、
417 主に診断を目的とする多くの情報を書き出す。
418 .TP
419 .B \-L --license -V --version
420 .\"O Display the software version, license terms and conditions.
421 ソフトウェアのバージョン・ライセンス・配布条件を表示する。
422 .TP
423 .\"O .B \-1 (or \-\-fast) to \-9 (or \-\-best)
424 .\"O Set the block size to 100 k, 200 k ..  900 k when compressing.  Has no
425 .\"O effect when decompressing.  See MEMORY MANAGEMENT below.
426 .B \-1 (または \-\-fast) から \-9 (または \-\-best)
427 圧縮の場合、ブロックサイズを 100 k, 200 k ..  900 k に設定する。
428 伸長の場合、何も影響を及ぼさない。
429 以下の「メモリ管理」セクションを参照すること。
430 .\"O The \-\-fast and \-\-best aliases are primarily for GNU gzip 
431 .\"O compatibility.  In particular, \-\-fast doesn't make things
432 .\"O significantly faster.  
433 .\"O And \-\-best merely selects the default behaviour.
434 \-\-fast と \-\-best エイリアスは、
435 主として GNU gzip との互換性のためにある。
436 特に \-\-fast オプションで目に見えて速くなる訳ではない。
437 また \-\-best は単にデフォルトの動作を選択するだけである。
438 .TP
439 .B \--
440 .\"O Treats all subsequent arguments as file names, even if they start
441 .\"O with a dash.  This is so you can handle files with names beginning
442 .\"O with a dash, for example: bzip2 \-- \-myfilename.
443 これ以降の引き数が、たとえダッシュで始まるものであっても、
444 ファイル名として扱う。
445 これにより、ダッシュで始まる名前のファイルを扱うことができる。
446 例を挙げる: bzip2 \-- \-myfilename
447 .TP
448 .B \--repetitive-fast --repetitive-best
449 .\"O These flags are redundant in versions 0.9.5 and above.  They provided
450 .\"O some coarse control over the behaviour of the sorting algorithm in
451 .\"O earlier versions, which was sometimes useful.  0.9.5 and above have an
452 .\"O improved algorithm which renders these flags irrelevant.
453 これらのフラグは、バージョン 0.9.5 以降では余計なものである。
454 これらのフラグは、以前のバージョンでソートアルゴリズムの動作を
455 大雑把に制御するために提供されたもので、時々は役立ったものである。
456 0.9.5 以降では、これらのフラグが無関係になる
457 改良されたアルゴリズムが使われている。
458
459 .\"O .SH MEMORY MANAGEMENT
460 .SH メモリ管理
461 .\"O .I bzip2 
462 .\"O compresses large files in blocks.  The block size affects
463 .\"O both the compression ratio achieved, and the amount of memory needed for
464 .\"O compression and decompression.  The flags \-1 through \-9
465 .\"O specify the block size to be 100,000 bytes through 900,000 bytes (the
466 .\"O default) respectively.  At decompression time, the block size used for
467 .\"O compression is read from the header of the compressed file, and
468 .\"O .I bunzip2
469 .\"O then allocates itself just enough memory to decompress
470 .\"O the file.  Since block sizes are stored in compressed files, it follows
471 .\"O that the flags \-1 to \-9 are irrelevant to and so ignored
472 .\"O during decompression.
473 .I bzip2
474 はブロック毎に大きなファイルを圧縮する。
475 ブロックサイズは、実行された結果の圧縮率と
476 圧縮・伸長に必要なメモリ使用量の両方に影響を及ぼす。
477 フラグ \-1 から \-9 は、それぞれブロックサイズ
478 100,000 バイトから (デフォルトの) 900,000 バイトを指定する。
479 伸長時には、圧縮に使われたブロックサイズが圧縮ファイルのヘッダから読み込まれ、
480 .I bunzip2
481 はファイルを伸長するのにちょうど十分なメモリを確保する。
482 ブロックサイズは圧縮ファイルに格納されているので、
483 伸長時にはフラグ \-1 から \-9 は関係なく無視される。
484
485 .\"O Compression and decompression requirements, 
486 .\"O in bytes, can be estimated as:
487 .\"O 
488 .\"O        Compression:   400k + ( 8 x block size )
489 .\"O 
490 .\"O        Decompression: 100k + ( 4 x block size ), or
491 .\"O                       100k + ( 2.5 x block size )
492 圧縮・伸縮に必要なメモリ使用量 (バイト単位) は、
493 以下のように計算できる:
494
495        圧縮:   400k + ( 8 x ブロックサイズ )
496
497        伸長:   100k + ( 4 x ブロックサイズ ), または
498                100k + ( 2.5 x ブロックサイズ )
499
500 .\"O Larger block sizes give rapidly diminishing marginal returns.  Most of
501 .\"O the compression comes from the first two or three hundred k of block
502 .\"O size, a fact worth bearing in mind when using
503 .\"O .I bzip2
504 .\"O on small machines.
505 .\"O It is also important to appreciate that the decompression memory
506 .\"O requirement is set at compression time by the choice of block size.
507 大きいブロックサイズにすると、境界の返り値をすぐに減少させる。
508 大部分の圧縮は、最初の 200kB から 300kB のブロックサイズでつくられる。
509 .I bzip2
510 をメモリの少ない計算機で使う場合は、
511 このことを覚えておく価値がある。
512 さらに、伸長に必要なメモリは、圧縮時にブロックサイズを選択することで
513 設定される点を知っておくことも重要である。
514
515 .\"O For files compressed with the default 900k block size,
516 .\"O .I bunzip2
517 .\"O will require about 3700 kbytes to decompress.  To support decompression
518 .\"O of any file on a 4 megabyte machine, 
519 .\"O .I bunzip2
520 .\"O has an option to
521 .\"O decompress using approximately half this amount of memory, about 2300
522 .\"O kbytes.  Decompression speed is also halved, so you should use this
523 .\"O option only where necessary.  The relevant flag is -s.
524 デフォルトの 900kB ブロックサイズで圧縮されたファイルに対して、
525 .I bunzip2
526 は伸長時に約 3700kB のメモリを必要とする。
527 4MB のメモリの計算機でファイル伸長をサポートするには、
528 .I bunzip2
529 このメモリ量の約半分、約 2300kB を使って伸長するオプションがある。
530 伸長速度も半分になるので、このオプションは必要な場合にのみ使うべきである。
531 関連するフラグとして -s がある。
532
533 .\"O In general, try and use the largest block size memory constraints allow,
534 .\"O since that maximises the compression achieved.  Compression and
535 .\"O decompression speed are virtually unaffected by block size.
536 一般的には、メモリの制限が許す限り一番大きなブロックサイズを使うこと。
537 こうすることで圧縮率が最も良くなる。
538 圧縮・伸長の速度は事実上ブロックサイズに影響されない。
539
540 .\"O Another significant point applies to files which fit in a single block
541 .\"O -- that means most files you'd encounter using a large block size.  The
542 .\"O amount of real memory touched is proportional to the size of the file,
543 .\"O since the file is smaller than a block.  For example, compressing a file
544 .\"O 20,000 bytes long with the flag -9 will cause the compressor to
545 .\"O allocate around 7600k of memory, but only touch 400k + 20000 * 8 = 560
546 .\"O kbytes of it.  Similarly, the decompressor will allocate 3700k but only
547 .\"O touch 100k + 20000 * 4 = 180 kbytes.
548 他に重要な点が単一のブロックに適用される。
549 -- つまり、入手する大部分のファイルは、
550 大きいブロックサイズを使っているということである。
551 このファイルのサイズはブロックサイズより小さいので、
552 実際のメモリ使用量はファイルサイズに比例する。
553 例えば、20,000 バイト (20kB) のファイルを -9 フラグで圧縮する場合、
554 7600kB のメモリが確保されるが、400k + 20000 * 8 = 560kB しか使用しない。
555 同様に、伸長時には 3700kB が確保されるが、
556 100k + 20000 * 4 = 180 kB しか使用しない。
557
558 .\"O Here is a table which summarises the maximum memory usage for different
559 .\"O block sizes.  Also recorded is the total compressed size for 14 files of
560 .\"O the Calgary Text Compression Corpus totalling 3,141,622 bytes.  This
561 .\"O column gives some feel for how compression varies with block size.
562 .\"O These figures tend to understate the advantage of larger block sizes for
563 .\"O larger files, since the Corpus is dominated by smaller files.
564 異なるブロックサイズに対しての最大メモリ使用量をまとめたテーブルを以下に示す。
565 カルガリー大学のテキスト圧縮コーパス
566 (14 個のファイル、合計 3,141,622 バイト) を
567 圧縮したサイズも記録されている。
568 行毎に比べると、ブロックサイズによって圧縮が
569 どのように変わるかを知ることができる。
570 この数字は、大きなファイルに対して大きなブロックサイズを使うことの利点を、
571 控え目にしか述べていない。
572 なぜなら、このコーパスが小さめのファイルで占められているためである。
573
574 .\"O            Compress   Decompress   Decompress   Corpus
575 .\"O     Flag     usage      usage       -s usage     Size
576             圧縮時の   伸長時の  -s 伸長時の  コーパスの
577    フラグ    使用量     使用量      使用量      サイズ
578
579      -1      1200k       500k         350k      914704
580      -2      2000k       900k         600k      877703
581      -3      2800k      1300k         850k      860338
582      -4      3600k      1700k        1100k      846899
583      -5      4400k      2100k        1350k      845160
584      -6      5200k      2500k        1600k      838626
585      -7      6100k      2900k        1850k      834096
586      -8      6800k      3300k        2100k      828642
587      -9      7600k      3700k        2350k      828642
588
589 .\"O .SH RECOVERING DATA FROM DAMAGED FILES
590 .SH 破損したファイルからのデータ復元
591 .\"O .I bzip2
592 .\"O compresses files in blocks, usually 900kbytes long.  Each
593 .\"O block is handled independently.  If a media or transmission error causes
594 .\"O a multi-block .bz2
595 .\"O file to become damaged, it may be possible to
596 .\"O recover data from the undamaged blocks in the file.
597 .I bzip2
598 は、通常 900kB のブロックでファイルを圧縮する。
599 各ブロックは独立に操作される。
600 メディアのエラーや転送エラーにより、
601 複数ブロックからなる .bz2 ファイルが破損しても、
602 ファイルの破損していないブロックからデータを復元できる可能性がある。
603
604 .\"O The compressed representation of each block is delimited by a 48-bit
605 .\"O pattern, which makes it possible to find the block boundaries with
606 .\"O reasonable certainty.  Each block also carries its own 32-bit CRC, so
607 .\"O damaged blocks can be distinguished from undamaged ones.
608 各ブロックの圧縮された表現は、48 ビットのパターンで区切られる。
609 このパターンにより、論理的な確実性を持ってブロック境界を見つけることができる。
610 各ブロックにはそれぞれの 32 ビット CRC があるので、
611 破損したブロックは破損していないものと区別できる。
612
613 .\"O .I bzip2recover
614 .\"O is a simple program whose purpose is to search for
615 .\"O blocks in .bz2 files, and write each block out into its own .bz2 
616 .\"O file.  You can then use
617 .\"O .I bzip2 
618 .\"O \-t
619 .\"O to test the
620 .\"O integrity of the resulting files, and decompress those which are
621 .\"O undamaged.
622 .I bzip2recover
623 は、.bz2 ファイルの各ブロックを検索し、
624 それ独自の .bz2 ファイルに各ブロックを書き出す。
625 ユーザーは、
626 .I bzip2 
627 \-t
628 を使って得られたファイルの完全性をテストし、
629 破損していないファイルとして伸長できる。
630
631 .\"O .I bzip2recover
632 .\"O takes a single argument, the name of the damaged file, 
633 .\"O and writes a number of files "rec00001file.bz2",
634 .\"O "rec00002file.bz2", etc, containing the  extracted  blocks.
635 .\"O The  output  filenames  are  designed  so  that the use of
636 .\"O wildcards in subsequent processing -- for example,  
637 .\"O "bzip2 -dc  rec*file.bz2 > recovered_data" -- processes the files in
638 .\"O the correct order.
639 .I bzip2recover
640 は、破損したファイルを唯一の引き数として受け取り、
641 抽出されたブロックを含んだ "rec00001file.bz2", "rec00002file.bz2", ...,
642 という多くのファイルを書き出す。
643 出力ファイルの名前は、
644 その後の処理でワイルドカードが使えるように設計されている
645 -- 例えば、
646 "bzip2 -dc  rec*file.bz2 > recovered_data" 
647 -- とすれば、ファイルを正しい順番で処理することができる。
648
649 .\"O .I bzip2recover
650 .\"O should be of most use dealing with large .bz2
651 .\"O files,  as  these will contain many blocks.  It is clearly
652 .\"O futile to use it on damaged single-block  files,  since  a
653 .\"O damaged  block  cannot  be recovered.  If you wish to minimise 
654 .\"O any potential data loss through media  or  transmission errors, 
655 .\"O you might consider compressing with a smaller
656 .\"O block size.
657 大きな .bz2 ファイルには多くのブロックが含まれているので、
658 .I bzip2recover
659 は、ほとんどの場合、このようなファイルを扱うために使われる。
660 1 ブロックが全て破損したブロックは復元できないので、
661 このようなファイルに対して使うのは明らかに無駄である。
662 メディアエラーや転送エラーによる潜在的なデータ損失を少なくしたいなら、
663 小さいブロックサイズで圧縮することを考えた方が良い。
664
665 .\"O .SH PERFORMANCE NOTES
666 .SH 性能に関する注意
667 .\"O The sorting phase of compression gathers together similar strings in the
668 .\"O file.  Because of this, files containing very long runs of repeated
669 .\"O symbols, like "aabaabaabaab ..."  (repeated several hundred times) may
670 .\"O compress more slowly than normal.  Versions 0.9.5 and above fare much
671 .\"O better than previous versions in this respect.  The ratio between
672 .\"O worst-case and average-case compression time is in the region of 10:1.
673 .\"O For previous versions, this figure was more like 100:1.  You can use the
674 .\"O \-vvvv option to monitor progress in great detail, if you want.
675 圧縮のソートフェーズでは、ファイル中の同一の文字列を集める。
676 そのため、"aabaabaabaab ..." のように (数百回)
677 同じシンボルが長く繰り返されているファイルは、
678 通常のものより圧縮が遅くなる。
679 バージョン 0.9.5 以降では以前のバージョンに比べると、この点が良くなっている。
680 圧縮時間の最も悪い場合と平均の場合の比率は、10:1 の範囲である。
681 以前のバージョンでは、この比率は 100:1 であった。
682 もし見てみたいなら、\-vvvv オプションを使って、
683 詳細な圧縮過程の進行を見ることができる。
684
685 .\"O Decompression speed is unaffected by these phenomena.
686 伸長は、この現象に影響されない。
687
688 .\"O .I bzip2
689 .\"O usually allocates several megabytes of memory to operate
690 .\"O in, and then charges all over it in a fairly random fashion.  This means
691 .\"O that performance, both for compressing and decompressing, is largely
692 .\"O determined by the speed at which your machine can service cache misses.
693 .\"O Because of this, small changes to the code to reduce the miss rate have
694 .\"O been observed to give disproportionately large performance improvements.
695 .\"O I imagine 
696 .\"O .I bzip2
697 .\"O will perform best on machines with very large caches.
698 .I bzip2
699 は通常、操作のために数メガバイトのメモリを確保し、
700 とてもランダムな方法で確保されたメモリを変更する。
701 これは、「圧縮・伸長の両方の性能は、
702 キャッシュにない場合に計算機が対応する速度に大きく依存する」
703 ということを意味する。
704 そのため、キャッシュにない割合を減らすためのちょっとしたコードの変更が、
705 非常に大きな性能の向上をもたらしたのを見たことがある。
706 .I bzip2
707 は、非常に大きなキャッシュを持った計算機で、
708 最も良い性能を発揮すると考えられる。
709
710 .\"O .SH CAVEATS
711 .SH 警告
712 .\"O I/O error messages are not as helpful as they could be.
713 .\"O .I bzip2
714 .\"O tries hard to detect I/O errors and exit cleanly, but the details of
715 .\"O what the problem is sometimes seem rather misleading.
716 I/O エラーのメッセージは、それほど役立たない。
717 .I bzip2
718 は、できるだけ I/O エラーを検知して正しく終了しようとする。
719 しかし、何が問題なのかの詳細は、ときどきかなり間違ったものに見える。
720
721 .\"O Compressed data created by this version is entirely forwards and
722 .\"O backwards compatible with the previous public releases, versions
723 .\"O 0.1pl2, 0.9.0, 0.9.5, 1.0.0 and 1.0.1, but with the following
724 .\"O exception: 0.9.0 and above can correctly decompress multiple
725 .\"O concatenated compressed files.  0.1pl2 cannot do this; it will stop
726 .\"O after decompressing just the first file in the stream.
727 この man ページは、バージョン 1.0.2 の
728 .I bzip2
729 について述べている。
730 このバージョンで生成された圧縮データは、
731 以前のパブリックリリースであるバージョン
732 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1 に対して、
733 前方互換と後方互換がある。
734 ただし、次のような例外がある:
735 0.9.0 以降では複数のファイルを連結して圧縮したファイルを伸長できるが、
736 0.1pl2 では伸長できず、ストリームの最初にあるファイルを伸長した後に停止する。
737
738 .\"O .I bzip2recover
739 .\"O versions prior to this one, 1.0.2, used 32-bit integers to represent
740 .\"O bit positions in compressed files, so it could not handle compressed
741 .\"O files more than 512 megabytes long.  
742 このバージョン 1.0.2 以前の
743 .I bzip2recover
744 は、圧縮ファイルでのビット位置を表現するために、32 ビットの整数を使う。
745 そのため 512MB 以上の圧縮ファイルを扱えない。
746 .\"O Version 1.0.2 and above uses
747 .\"O 64-bit ints on some platforms which support them (GNU supported
748 .\"O targets, and Windows).  
749 バージョン 1.0.2 とそれ以前のものでも、
750 サポート可能なプラットフォーム
751 (GNU がサポートするターゲットと Windows) では、
752 64 ビット int を使用していた。
753 .\"O To establish whether or not bzip2recover was
754 .\"O built with such a limitation, run it without arguments.  
755 この制限を付けて bzip2recover がビルドされているかを確認するには、
756 引き数なしで実行すれば良い。
757 .\"O In any event
758 .\"O you can build yourself an unlimited version if you can recompile it
759 .\"O with MaybeUInt64 set to be an unsigned 64-bit integer.
760 少なくとも MaybeUInt64 を符号なし 64 ビット整数型に設定して
761 再コンパイルすることにより、
762 非制限バージョンをビルドすることができる。
763
764
765
766 .\"O .SH AUTHOR
767 .SH 著者
768 Julian Seward, jseward@acm.org.
769
770 http://sources.redhat.com/bzip2
771
772 .\"O The ideas embodied in
773 .\"O .I bzip2
774 .\"O are due to (at least) the following
775 .\"O people: Michael Burrows and David Wheeler (for the block sorting
776 .\"O transformation), David Wheeler (again, for the Huffman coder), Peter
777 .\"O Fenwick (for the structured coding model in the original
778 .\"O .I bzip,
779 .\"O and many refinements), and Alistair Moffat, Radford Neal and Ian Witten
780 .\"O (for the arithmetic coder in the original
781 .\"O .I bzip).  
782 .I bzip2
783 に含まれているアイディアは、(少なくとも) 以下の方々のおかげである:
784 Michael Burrows, David Wheeler (ブロックソート変換),
785 David Wheeler (Huffman コード化についても), 
786 Peter Fenwick (オリジナルの
787 .I bzip
788 における構造化コード化モデル、そして多くの改良), 
789 Alistair Moffat, Radford Neal, Ian Witten (オリジナルの
790 .I bzip
791 における算術コード化)。  
792 .\"O I am much
793 .\"O indebted for their help, support and advice.  See the manual in the
794 .\"O source distribution for pointers to sources of documentation.  Christian
795 .\"O von Roques encouraged me to look for faster sorting algorithms, so as to
796 .\"O speed up compression.  Bela Lubkin encouraged me to improve the
797 .\"O worst-case compression performance.  
798 .\"O The bz* scripts are derived from those of GNU gzip.
799 .\"O Many people sent patches, helped
800 .\"O with portability problems, lent machines, gave advice and were generally
801 .\"O helpful.
802 私は、彼らの助け・サポート・助言に対して感謝している。
803 ドキュメントのソースの場所については、
804 ソース配布の中のマニュアルを参照すること。
805 Christian von Roques は、圧縮速度の向上のために、
806 より速いソートアルゴリズムを探すことを勧めてくれた。
807 Bela Lubkin は、圧縮速度が最も遅い場合の改良を勧めてくれた。
808 bz* スクリプトは GNU gzip のものに由来している。
809 多くの方々がパッチを送り、軽便性の問題について助けてくれた。
810 また、計算機を貸してくれたり、アドバイスをしてくれた人達もいた。
811 これらは全て助けになった。