⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 manual.xml.svn-base

📁 絲路server源碼 Silk Road server source
💻 SVN-BASE
📖 第 1 页 / 共 5 页
字号:
 <listitem><para>Force decompression.  <computeroutput>bzip2</computeroutput>,  <computeroutput>bunzip2</computeroutput> and  <computeroutput>bzcat</computeroutput> are really the same  program, and the decision about what actions to take is done on  the basis of which name is used.  This flag overrides that  mechanism, and forces bzip2 to decompress.</para></listitem> </varlistentry> <varlistentry> <term><computeroutput>-z --compress</computeroutput></term> <listitem><para>The complement to  <computeroutput>-d</computeroutput>: forces compression,  regardless of the invokation name.</para></listitem> </varlistentry> <varlistentry> <term><computeroutput>-t --test</computeroutput></term> <listitem><para>Check integrity of the specified file(s), but  don't decompress them.  This really performs a trial  decompression and throws away the result.</para></listitem> </varlistentry> <varlistentry> <term><computeroutput>-f --force</computeroutput></term> <listitem><para>Force overwrite of output files.  Normally,  <computeroutput>bzip2</computeroutput> will not overwrite  existing output files.  Also forces  <computeroutput>bzip2</computeroutput> to break hard links to  files, which it otherwise wouldn't do.</para>  <para><computeroutput>bzip2</computeroutput> normally declines  to decompress files which don't have the correct magic header  bytes. If forced (<computeroutput>-f</computeroutput>),  however, it will pass such files through unmodified. This is  how GNU <computeroutput>gzip</computeroutput> behaves.</para> </listitem> </varlistentry> <varlistentry> <term><computeroutput>-k --keep</computeroutput></term> <listitem><para>Keep (don't delete) input files during  compression or decompression.</para></listitem> </varlistentry> <varlistentry> <term><computeroutput>-s --small</computeroutput></term> <listitem><para>Reduce memory usage, for compression,  decompression and testing.  Files are decompressed and tested  using a modified algorithm which only requires 2.5 bytes per  block byte.  This means any file can be decompressed in 2300k  of memory, albeit at about half the normal speed.</para>  <para>During compression, <computeroutput>-s</computeroutput>  selects a block size of 200k, which limits memory use to around  the same figure, at the expense of your compression ratio.  In  short, if your machine is low on memory (8 megabytes or less),  use <computeroutput>-s</computeroutput> for everything.  See  <xref linkend="memory-management"/> below.</para></listitem> </varlistentry> <varlistentry> <term><computeroutput>-q --quiet</computeroutput></term> <listitem><para>Suppress non-essential warning messages.  Messages pertaining to I/O errors and other critical events  will not be suppressed.</para></listitem> </varlistentry> <varlistentry> <term><computeroutput>-v --verbose</computeroutput></term> <listitem><para>Verbose mode -- show the compression ratio for  each file processed.  Further  <computeroutput>-v</computeroutput>'s increase the verbosity  level, spewing out lots of information which is primarily of  interest for diagnostic purposes.</para></listitem> </varlistentry> <varlistentry> <term><computeroutput>-L --license -V --version</computeroutput></term> <listitem><para>Display the software version, license terms and  conditions.</para></listitem> </varlistentry> <varlistentry> <term><computeroutput>-1</computeroutput> (or <computeroutput>--fast</computeroutput>) to <computeroutput>-9</computeroutput> (or <computeroutput>-best</computeroutput>)</term> <listitem><para>Set the block size to 100 k, 200 k ...  900 k  when compressing.  Has no effect when decompressing.  See <xref  linkend="memory-management" /> below.  The  <computeroutput>--fast</computeroutput> and  <computeroutput>--best</computeroutput> aliases are primarily  for GNU <computeroutput>gzip</computeroutput> compatibility.  In particular, <computeroutput>--fast</computeroutput> doesn't  make things significantly faster.  And  <computeroutput>--best</computeroutput> merely selects the  default behaviour.</para></listitem> </varlistentry> <varlistentry> <term><computeroutput>--</computeroutput></term> <listitem><para>Treats all subsequent arguments as file names,  even if they start with a dash.  This is so you can handle  files with names beginning with a dash, for example:  <computeroutput>bzip2 --  -myfilename</computeroutput>.</para></listitem> </varlistentry> <varlistentry> <term><computeroutput>--repetitive-fast</computeroutput></term> <term><computeroutput>--repetitive-best</computeroutput></term> <listitem><para>These flags are redundant in versions 0.9.5 and  above.  They provided some coarse control over the behaviour of  the sorting algorithm in earlier versions, which was sometimes  useful.  0.9.5 and above have an improved algorithm which  renders these flags irrelevant.</para></listitem> </varlistentry></variablelist></sect1><sect1 id="memory-management" xreflabel="MEMORY MANAGEMENT"><title>MEMORY MANAGEMENT</title><para><computeroutput>bzip2</computeroutput> compresses largefiles in blocks.  The block size affects both the compressionratio achieved, and the amount of memory needed for compressionand decompression.  The flags <computeroutput>-1</computeroutput>through <computeroutput>-9</computeroutput> specify the blocksize to be 100,000 bytes through 900,000 bytes (the default)respectively.  At decompression time, the block size used forcompression is read from the header of the compressed file, and<computeroutput>bunzip2</computeroutput> then allocates itselfjust enough memory to decompress the file.  Since block sizes arestored in compressed files, it follows that the flags<computeroutput>-1</computeroutput> to<computeroutput>-9</computeroutput> are irrelevant to and soignored during decompression.</para><para>Compression and decompression requirements, in bytes, can beestimated as:</para><programlisting>Compression:   400k + ( 8 x block size )Decompression: 100k + ( 4 x block size ), or               100k + ( 2.5 x block size )</programlisting><para>Larger block sizes give rapidly diminishing marginalreturns.  Most of the compression comes from the first two orthree hundred k of block size, a fact worth bearing in mind whenusing <computeroutput>bzip2</computeroutput> on small machines.It is also important to appreciate that the decompression memoryrequirement is set at compression time by the choice of blocksize.</para><para>For files compressed with the default 900k block size,<computeroutput>bunzip2</computeroutput> will require about 3700kbytes to decompress.  To support decompression of any file on a4 megabyte machine, <computeroutput>bunzip2</computeroutput> hasan option to decompress using approximately half this amount ofmemory, about 2300 kbytes.  Decompression speed is also halved,so you should use this option only where necessary.  The relevantflag is <computeroutput>-s</computeroutput>.</para><para>In general, try and use the largest block size memoryconstraints allow, since that maximises the compression achieved.Compression and decompression speed are virtually unaffected byblock size.</para><para>Another significant point applies to files which fit in asingle block -- that means most files you'd encounter using alarge block size.  The amount of real memory touched isproportional to the size of the file, since the file is smallerthan a block.  For example, compressing a file 20,000 bytes longwith the flag <computeroutput>-9</computeroutput> will cause thecompressor to allocate around 7600k of memory, but only touch400k + 20000 * 8 = 560 kbytes of it.  Similarly, the decompressorwill allocate 3700k but only touch 100k + 20000 * 4 = 180kbytes.</para><para>Here is a table which summarises the maximum memory usagefor different block sizes.  Also recorded is the total compressedsize for 14 files of the Calgary Text Compression Corpustotalling 3,141,622 bytes.  This column gives some feel for howcompression varies with block size.  These figures tend tounderstate the advantage of larger block sizes for larger files,since the Corpus is dominated by smaller files.</para><programlisting>        Compress   Decompress   Decompress   CorpusFlag     usage      usage       -s usage     Size -1      1200k       500k         350k      914704 -2      2000k       900k         600k      877703 -3      2800k      1300k         850k      860338 -4      3600k      1700k        1100k      846899 -5      4400k      2100k        1350k      845160 -6      5200k      2500k        1600k      838626 -7      6100k      2900k        1850k      834096 -8      6800k      3300k        2100k      828642 -9      7600k      3700k        2350k      828642</programlisting></sect1><sect1 id="recovering" xreflabel="RECOVERING DATA FROM DAMAGED FILES"><title>RECOVERING DATA FROM DAMAGED FILES</title><para><computeroutput>bzip2</computeroutput> compresses files inblocks, usually 900kbytes long.  Each block is handledindependently.  If a media or transmission error causes amulti-block <computeroutput>.bz2</computeroutput> file to becomedamaged, it may be possible to recover data from the undamagedblocks in the file.</para><para>The compressed representation of each block is delimited bya 48-bit pattern, which makes it possible to find the blockboundaries with reasonable certainty.  Each block also carriesits own 32-bit CRC, so damaged blocks can be distinguished fromundamaged ones.</para><para><computeroutput>bzip2recover</computeroutput> is a simpleprogram whose purpose is to search for blocks in<computeroutput>.bz2</computeroutput> files, and write each blockout into its own <computeroutput>.bz2</computeroutput> file.  Youcan then use <computeroutput>bzip2 -t</computeroutput> to testthe integrity of the resulting files, and decompress those whichare undamaged.</para><para><computeroutput>bzip2recover</computeroutput> takes asingle argument, the name of the damaged file, and writes anumber of files <computeroutput>rec0001file.bz2</computeroutput>,<computeroutput>rec0002file.bz2</computeroutput>, etc, containingthe extracted blocks.  The output filenames are designed so thatthe use of wildcards in subsequent processing -- for example,<computeroutput>bzip2 -dc rec*file.bz2 &#62;recovered_data</computeroutput> -- lists the files in the correctorder.</para><para><computeroutput>bzip2recover</computeroutput> should be ofmost use dealing with large <computeroutput>.bz2</computeroutput>files, as these will contain many blocks.  It is clearly futileto use it on damaged single-block files, since a damaged blockcannot be recovered.  If you wish to minimise any potential dataloss through media or transmission errors, you might considercompressing with a smaller block size.</para></sect1><sect1 id="performance" xreflabel="PERFORMANCE NOTES"><title>PERFORMANCE NOTES</title><para>The sorting phase of compression gathers together similarstrings in the file.  Because of this, files containing very longruns of repeated symbols, like "aabaabaabaab ..."  (repeatedseveral hundred times) may compress more slowly than normal.Versions 0.9.5 and above fare much better than previous versionsin this respect.  The ratio between worst-case and average-casecompression time is in the region of 10:1.  For previousversions, this figure was more like 100:1.  You can use the<computeroutput>-vvvv</computeroutput> option to monitor progressin great detail, if you want.</para><para>Decompression speed is unaffected by thesephenomena.</para><para><computeroutput>bzip2</computeroutput> usually allocatesseveral megabytes of memory to operate in, and then charges allover it in a fairly random fashion.  This means that performance,both for compressing and decompressing, is largely determined bythe speed at which your machine can service cache misses.Because of this, small changes to the code to reduce the missrate have been observed to give disproportionately largeperformance improvements.  I imagine<computeroutput>bzip2</computeroutput> will perform best onmachines with very large caches.</para></sect1><sect1 id="caveats" xreflabel="CAVEATS"><title>CAVEATS</title><para>I/O error messages are not as helpful as they could be.<computeroutput>bzip2</computeroutput> tries hard to detect I/Oerrors and exit cleanly, but the details of what the problem issometimes seem rather misleading.</para><para>This manual page pertains to version &bz-version; of<computeroutput>bzip2</computeroutput>.  Compressed data createdby this version is entirely forwards and backwards compatiblewith the previous public releases, versions 0.1pl2, 0.9.0 and0.9.5, 1.0.0, 1.0.1 and 1.0.2, but with the following exception: 0.9.0and above can correctly decompress multiple concatenatedcompressed files.  0.1pl2 cannot do this; it will stop afterdecompressing just the first file in the stream.</para><para><computeroutput>bzip2recover</computeroutput> versionsprior to 1.0.2 used 32-bit integers to represent bit positions incompressed files, so it could not handle compressed files morethan 512 megabytes long.  Versions 1.0.2 and above use 64-bit intson some platforms which support them (GNU supported targets, andWindows). To establish whether or not<computeroutput>bzip2recover</computeroutput> was built with sucha limitation, run it without arguments. In any event you canbuild yourself an unlimited version if you can recompile it with<computeroutput>MaybeUInt64</computeroutput> set to be anunsigned 64-bit integer.</para></sect1><sect1 id="author" xreflabel="AUTHOR"><title>AUTHOR</title><para>Julian Seward,<computeroutput>&bz-email;</computeroutput></para><para>The ideas embodied in<computeroutput>bzip2</computeroutput> are due to (at least) thefollowing people: Michael Burrows and David Wheeler (for theblock sorting transformation), David Wheeler (again, for theHuffman coder), Peter Fenwick (for the structured coding model inthe original <computeroutput>bzip</computeroutput>, and manyrefinements), and Alistair Moffat, Radford Neal and Ian Witten(for the arithmetic coder in the original<computeroutput>bzip</computeroutput>).  I am much indebted for

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -