Merging upstream version 1.9.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
c7dcd442c7
commit
48c5ddf50f
29 changed files with 2003 additions and 1566 deletions
319
doc/plzip.texi
319
doc/plzip.texi
|
@ -6,8 +6,8 @@
|
|||
@finalout
|
||||
@c %**end of header
|
||||
|
||||
@set UPDATED 5 January 2019
|
||||
@set VERSION 1.8
|
||||
@set UPDATED 3 January 2021
|
||||
@set VERSION 1.9
|
||||
|
||||
@dircategory Data Compression
|
||||
@direntry
|
||||
|
@ -29,6 +29,7 @@
|
|||
@contents
|
||||
@end ifnothtml
|
||||
|
||||
@ifnottex
|
||||
@node Top
|
||||
@top
|
||||
|
||||
|
@ -49,35 +50,47 @@ This manual is for Plzip (version @value{VERSION}, @value{UPDATED}).
|
|||
@end menu
|
||||
|
||||
@sp 1
|
||||
Copyright @copyright{} 2009-2019 Antonio Diaz Diaz.
|
||||
Copyright @copyright{} 2009-2021 Antonio Diaz Diaz.
|
||||
|
||||
This manual is free documentation: you have unlimited permission
|
||||
to copy, distribute and modify it.
|
||||
This manual is free documentation: you have unlimited permission to copy,
|
||||
distribute, and modify it.
|
||||
@end ifnottex
|
||||
|
||||
|
||||
@node Introduction
|
||||
@chapter Introduction
|
||||
@cindex introduction
|
||||
|
||||
@uref{http://www.nongnu.org/lzip/plzip.html,,Plzip} is a massively parallel
|
||||
(multi-threaded) implementation of lzip, fully compatible with lzip 1.4 or
|
||||
newer. Plzip uses the lzlib compression library.
|
||||
@uref{http://www.nongnu.org/lzip/plzip.html,,Plzip}
|
||||
is a massively parallel (multi-threaded) implementation of lzip, fully
|
||||
compatible with lzip 1.4 or newer. Plzip uses the compression library
|
||||
@uref{http://www.nongnu.org/lzip/lzlib.html,,lzlib}.
|
||||
|
||||
@uref{http://www.nongnu.org/lzip/lzip.html,,Lzip} is a lossless data
|
||||
compressor with a user interface similar to the one of gzip or bzip2. Lzip
|
||||
can compress about as fast as gzip @w{(lzip -0)} or compress most files more
|
||||
than bzip2 @w{(lzip -9)}. Decompression speed is intermediate between gzip
|
||||
and bzip2. Lzip is better than gzip and bzip2 from a data recovery
|
||||
perspective. Lzip has been designed, written and tested with great care to
|
||||
replace gzip and bzip2 as the standard general-purpose compressed format for
|
||||
unix-like systems.
|
||||
@uref{http://www.nongnu.org/lzip/lzip.html,,Lzip}
|
||||
is a lossless data compressor with a user interface similar to the one
|
||||
of gzip or bzip2. Lzip uses a simplified form of the 'Lempel-Ziv-Markov
|
||||
chain-Algorithm' (LZMA) stream format, chosen to maximize safety and
|
||||
interoperability. Lzip can compress about as fast as gzip @w{(lzip -0)} or
|
||||
compress most files more than bzip2 @w{(lzip -9)}. Decompression speed is
|
||||
intermediate between gzip and bzip2. Lzip is better than gzip and bzip2 from
|
||||
a data recovery perspective. Lzip has been designed, written, and tested
|
||||
with great care to replace gzip and bzip2 as the standard general-purpose
|
||||
compressed format for unix-like systems.
|
||||
|
||||
Plzip can compress/decompress large files on multiprocessor machines
|
||||
much faster than lzip, at the cost of a slightly reduced compression
|
||||
ratio (0.4 to 2 percent larger compressed files). Note that the number
|
||||
of usable threads is limited by file size; on files larger than a few GB
|
||||
plzip can use hundreds of processors, but on files of only a few MB
|
||||
plzip is no faster than lzip. @xref{Minimum file sizes}.
|
||||
Plzip can compress/decompress large files on multiprocessor machines much
|
||||
faster than lzip, at the cost of a slightly reduced compression ratio (0.4
|
||||
to 2 percent larger compressed files). Note that the number of usable
|
||||
threads is limited by file size; on files larger than a few GB plzip can use
|
||||
hundreds of processors, but on files of only a few MB plzip is no faster
|
||||
than lzip. @xref{Minimum file sizes}.
|
||||
|
||||
For creation and manipulation of compressed tar archives
|
||||
@uref{http://www.nongnu.org/lzip/manual/tarlz_manual.html,,tarlz} can be
|
||||
more efficient than using tar and plzip because tarlz is able to keep the
|
||||
alignment between tar members and lzip members.
|
||||
@ifnothtml
|
||||
@xref{Top,tarlz manual,,tarlz}.
|
||||
@end ifnothtml
|
||||
|
||||
The lzip file format is designed for data sharing and long-term archiving,
|
||||
taking into account both data integrity and decoder availability:
|
||||
|
@ -85,11 +98,11 @@ taking into account both data integrity and decoder availability:
|
|||
@itemize @bullet
|
||||
@item
|
||||
The lzip format provides very safe integrity checking and some data
|
||||
recovery means. The
|
||||
recovery means. The program
|
||||
@uref{http://www.nongnu.org/lzip/manual/lziprecover_manual.html#Data-safety,,lziprecover}
|
||||
program can repair bit flip errors (one of the most common forms of data
|
||||
corruption) in lzip files, and provides data recovery capabilities,
|
||||
including error-checked merging of damaged copies of a file.
|
||||
can repair bit flip errors (one of the most common forms of data corruption)
|
||||
in lzip files, and provides data recovery capabilities, including
|
||||
error-checked merging of damaged copies of a file.
|
||||
@ifnothtml
|
||||
@xref{Data safety,,,lziprecover}.
|
||||
@end ifnothtml
|
||||
|
@ -107,10 +120,10 @@ Additionally the lzip reference implementation is copylefted, which
|
|||
guarantees that it will remain free forever.
|
||||
@end itemize
|
||||
|
||||
A nice feature of the lzip format is that a corrupt byte is easier to
|
||||
repair the nearer it is from the beginning of the file. Therefore, with
|
||||
the help of lziprecover, losing an entire archive just because of a
|
||||
corrupt byte near the beginning is a thing of the past.
|
||||
A nice feature of the lzip format is that a corrupt byte is easier to repair
|
||||
the nearer it is from the beginning of the file. Therefore, with the help of
|
||||
lziprecover, losing an entire archive just because of a corrupt byte near
|
||||
the beginning is a thing of the past.
|
||||
|
||||
Plzip uses the same well-defined exit status values used by lzip, which
|
||||
makes it safer than compressors returning ambiguous warning values (like
|
||||
|
@ -138,13 +151,12 @@ possible, ownership of the file just as @samp{cp -p} does. (If the user ID or
|
|||
the group ID can't be duplicated, the file permission bits S_ISUID and
|
||||
S_ISGID are cleared).
|
||||
|
||||
Plzip is able to read from some types of non regular files if the
|
||||
@samp{--stdout} option is specified.
|
||||
Plzip is able to read from some types of non-regular files if either the
|
||||
option @samp{-c} or the option @samp{-o} is specified.
|
||||
|
||||
If no file names are specified, plzip compresses (or decompresses) from
|
||||
standard input to standard output. In this case, plzip will decline to
|
||||
write compressed output to a terminal, as this would be entirely
|
||||
incomprehensible and therefore pointless.
|
||||
Plzip will refuse to read compressed data from a terminal or write compressed
|
||||
data to a terminal, as this would be entirely incomprehensible and might
|
||||
leave the terminal in an abnormal state.
|
||||
|
||||
Plzip will correctly decompress a file which is the concatenation of two or
|
||||
more compressed files. The result is the concatenation of the corresponding
|
||||
|
@ -162,16 +174,16 @@ The output of plzip looks like this:
|
|||
plzip -v foo
|
||||
foo: 6.676:1, 14.98% ratio, 85.02% saved, 450560 in, 67493 out.
|
||||
|
||||
plzip -tvv foo.lz
|
||||
foo.lz: 6.676:1, 14.98% ratio, 85.02% saved. ok
|
||||
plzip -tvvv foo.lz
|
||||
foo.lz: 6.676:1, 14.98% ratio, 85.02% saved. 450560 out, 67493 in. ok
|
||||
@end example
|
||||
|
||||
The meaning of each field is as follows:
|
||||
|
||||
@table @code
|
||||
@item N:1
|
||||
The compression ratio @w{(uncompressed_size / compressed_size)}, shown
|
||||
as N to 1.
|
||||
The compression ratio @w{(uncompressed_size / compressed_size)}, shown as
|
||||
@w{N to 1}.
|
||||
|
||||
@item ratio
|
||||
The inverse compression ratio @w{(compressed_size / uncompressed_size)},
|
||||
|
@ -182,23 +194,23 @@ decimal point two places to the left; @w{14.98% = 0.1498}.
|
|||
The space saved by compression @w{(1 - ratio)}, shown as a percentage.
|
||||
|
||||
@item in
|
||||
The size of the uncompressed data. When decompressing or testing, it is
|
||||
shown as @code{decompressed}. Note that plzip always prints the
|
||||
uncompressed size before the compressed size when compressing,
|
||||
decompressing, testing or listing.
|
||||
Size of the input data. This is the uncompressed size when compressing, or
|
||||
the compressed size when decompressing or testing. Note that plzip always
|
||||
prints the uncompressed size before the compressed size when compressing,
|
||||
decompressing, testing, or listing.
|
||||
|
||||
@item out
|
||||
The size of the compressed data. When decompressing or testing, it is
|
||||
shown as @code{compressed}.
|
||||
Size of the output data. This is the compressed size when compressing, or
|
||||
the decompressed size when decompressing or testing.
|
||||
|
||||
@end table
|
||||
|
||||
When decompressing or testing at verbosity level 4 (-vvvv), the
|
||||
dictionary size used to compress the file is also shown.
|
||||
When decompressing or testing at verbosity level 4 (-vvvv), the dictionary
|
||||
size used to compress the file is also shown.
|
||||
|
||||
LANGUAGE NOTE: Uncompressed = not compressed = plain data; it may never
|
||||
have been compressed. Decompressed is used to refer to data which have
|
||||
undergone the process of decompression.
|
||||
LANGUAGE NOTE: Uncompressed = not compressed = plain data; it may never have
|
||||
been compressed. Decompressed is used to refer to data which have undergone
|
||||
the process of decompression.
|
||||
|
||||
|
||||
@node Invoking plzip
|
||||
|
@ -215,11 +227,16 @@ plzip [@var{options}] [@var{files}]
|
|||
@end example
|
||||
|
||||
@noindent
|
||||
@samp{-} used as a @var{file} argument means standard input. It can be
|
||||
mixed with other @var{files} and is read just once, the first time it
|
||||
appears in the command line.
|
||||
If no file names are specified, plzip compresses (or decompresses) from
|
||||
standard input to standard output. A hyphen @samp{-} used as a @var{file}
|
||||
argument means standard input. It can be mixed with other @var{files} and is
|
||||
read just once, the first time it appears in the command line.
|
||||
|
||||
plzip supports the following options:
|
||||
plzip supports the following
|
||||
@uref{http://www.nongnu.org/arg-parser/manual/arg_parser_manual.html#Argument-syntax,,options}:
|
||||
@ifnothtml
|
||||
@xref{Argument syntax,,,arg_parser}.
|
||||
@end ifnothtml
|
||||
|
||||
@table @code
|
||||
@item -h
|
||||
|
@ -246,18 +263,20 @@ input file will be divided in chunks of this size before compression is
|
|||
performed. Valid values range from @w{8 KiB} to @w{1 GiB}. Default value
|
||||
is two times the dictionary size, except for option @samp{-0} where it
|
||||
defaults to @w{1 MiB}. Plzip will reduce the dictionary size if it is
|
||||
larger than the chosen data size.
|
||||
larger than the data size specified. @xref{Minimum file sizes}.
|
||||
|
||||
@item -c
|
||||
@itemx --stdout
|
||||
Compress or decompress to standard output; keep input files unchanged.
|
||||
If compressing several files, each file is compressed independently.
|
||||
This option is needed when reading from a named pipe (fifo) or from a
|
||||
device.
|
||||
Compress or decompress to standard output; keep input files unchanged. If
|
||||
compressing several files, each file is compressed independently. This
|
||||
option (or @samp{-o}) is needed when reading from a named pipe (fifo) or
|
||||
from a device. Use @w{@samp{lziprecover -cd -i}} to recover as much of the
|
||||
decompressed data as possible when decompressing a corrupt file. @samp{-c}
|
||||
overrides @samp{-o}. @samp{-c} has no effect when testing or listing.
|
||||
|
||||
@item -d
|
||||
@itemx --decompress
|
||||
Decompress the specified files. If a file does not exist or can't be
|
||||
Decompress the files specified. If a file does not exist or can't be
|
||||
opened, plzip continues decompressing the rest of the files. If a file
|
||||
fails to decompress, or is a terminal, plzip exits immediately without
|
||||
decompressing the rest of the files.
|
||||
|
@ -277,17 +296,18 @@ Keep (don't delete) input files during compression or decompression.
|
|||
|
||||
@item -l
|
||||
@itemx --list
|
||||
Print the uncompressed size, compressed size and percentage saved of the
|
||||
specified files. Trailing data are ignored. The values produced are
|
||||
correct even for multimember files. If more than one file is given, a
|
||||
final line containing the cumulative sizes is printed. With @samp{-v},
|
||||
the dictionary size, the number of members in the file, and the amount
|
||||
of trailing data (if any) are also printed. With @samp{-vv}, the
|
||||
positions and sizes of each member in multimember files are also
|
||||
printed. @samp{-lq} can be used to verify quickly (without
|
||||
decompressing) the structural integrity of the specified files. (Use
|
||||
@samp{--test} to verify the data integrity). @samp{-alq} additionally
|
||||
verifies that none of the specified files contain trailing data.
|
||||
Print the uncompressed size, compressed size, and percentage saved of the
|
||||
files specified. Trailing data are ignored. The values produced are correct
|
||||
even for multimember files. If more than one file is given, a final line
|
||||
containing the cumulative sizes is printed. With @samp{-v}, the dictionary
|
||||
size, the number of members in the file, and the amount of trailing data (if
|
||||
any) are also printed. With @samp{-vv}, the positions and sizes of each
|
||||
member in multimember files are also printed.
|
||||
|
||||
@samp{-lq} can be used to verify quickly (without decompressing) the
|
||||
structural integrity of the files specified. (Use @samp{--test} to verify
|
||||
the data integrity). @samp{-alq} additionally verifies that none of the
|
||||
files specified contain trailing data.
|
||||
|
||||
@item -m @var{bytes}
|
||||
@itemx --match-length=@var{bytes}
|
||||
|
@ -298,27 +318,36 @@ compression times.
|
|||
|
||||
@item -n @var{n}
|
||||
@itemx --threads=@var{n}
|
||||
Set the number of worker threads, overriding the system's default. Valid
|
||||
values range from 1 to "as many as your system can support". If this
|
||||
option is not used, plzip tries to detect the number of processors in
|
||||
the system and use it as default value. When compressing on a @w{32 bit}
|
||||
system, plzip tries to limit the memory use to under @w{2.22 GiB} (4
|
||||
worker threads at level -9) by reducing the number of threads below the
|
||||
system's default. @w{@samp{plzip --help}} shows the system's default
|
||||
value.
|
||||
Set the maximum number of worker threads, overriding the system's default.
|
||||
Valid values range from 1 to "as many as your system can support". If this
|
||||
option is not used, plzip tries to detect the number of processors in the
|
||||
system and use it as default value. When compressing on a @w{32 bit} system,
|
||||
plzip tries to limit the memory use to under @w{2.22 GiB} (4 worker threads
|
||||
at level -9) by reducing the number of threads below the system's default.
|
||||
@w{@samp{plzip --help}} shows the system's default value.
|
||||
|
||||
Note that the number of usable threads is limited to @w{ceil( file_size
|
||||
/ data_size )} during compression (@pxref{Minimum file sizes}), and to
|
||||
the number of members in the input during decompression.
|
||||
Plzip starts the number of threads required by each file without exceeding
|
||||
the value specified. Note that the number of usable threads is limited to
|
||||
@w{ceil( file_size / data_size )} during compression (@pxref{Minimum file
|
||||
sizes}), and to the number of members in the input during decompression. You
|
||||
can find the number of members in a lzip file by running
|
||||
@w{@samp{plzip -lv file.lz}}.
|
||||
|
||||
@item -o @var{file}
|
||||
@itemx --output=@var{file}
|
||||
When reading from standard input and @samp{--stdout} has not been
|
||||
specified, use @samp{@var{file}} as the virtual name of the uncompressed
|
||||
file. This produces a file named @samp{@var{file}} when decompressing,
|
||||
or a file named @samp{@var{file}.lz} when compressing. A second
|
||||
@samp{.lz} extension is not added if @samp{@var{file}} already ends in
|
||||
@samp{.lz} or @samp{.tlz}.
|
||||
If @samp{-c} has not been also specified, write the (de)compressed output to
|
||||
@var{file}; keep input files unchanged. If compressing several files, each
|
||||
file is compressed independently. This option (or @samp{-c}) is needed when
|
||||
reading from a named pipe (fifo) or from a device. @w{@samp{-o -}} is
|
||||
equivalent to @samp{-c}. @samp{-o} has no effect when testing or listing.
|
||||
|
||||
In order to keep backward compatibility with plzip versions prior to 1.9,
|
||||
when compressing from standard input and no other file names are given, the
|
||||
extension @samp{.lz} is appended to @var{file} unless it already ends in
|
||||
@samp{.lz} or @samp{.tlz}. This feature will be removed in a future version
|
||||
of plzip. Meanwhile, redirection may be used instead of @samp{-o} to write
|
||||
the compressed output to a file without the extension @samp{.lz} in its
|
||||
name: @w{@samp{plzip < file > foo}}.
|
||||
|
||||
@item -q
|
||||
@itemx --quiet
|
||||
|
@ -331,7 +360,7 @@ for each file the largest dictionary size that does not exceed neither
|
|||
the file size nor this limit. Valid values range from @w{4 KiB} to
|
||||
@w{512 MiB}. Values 12 to 29 are interpreted as powers of two, meaning
|
||||
2^12 to 2^29 bytes. Dictionary sizes are quantized so that they can be
|
||||
coded in just one byte (@pxref{coded-dict-size}). If the specified size
|
||||
coded in just one byte (@pxref{coded-dict-size}). If the size specified
|
||||
does not match one of the valid sizes, it will be rounded upwards by
|
||||
adding up to @w{(@var{bytes} / 8)} to it.
|
||||
|
||||
|
@ -341,12 +370,13 @@ is affected at compression time by the choice of dictionary size limit.
|
|||
|
||||
@item -t
|
||||
@itemx --test
|
||||
Check integrity of the specified files, but don't decompress them. This
|
||||
Check integrity of the files specified, but don't decompress them. This
|
||||
really performs a trial decompression and throws away the result. Use it
|
||||
together with @samp{-v} to see information about the files. If a file
|
||||
does not exist, can't be opened, or is a terminal, plzip continues
|
||||
checking the rest of the files. If a file fails the test, plzip may be
|
||||
unable to check the rest of the files.
|
||||
fails the test, does not exist, can't be opened, or is a terminal, plzip
|
||||
continues checking the rest of the files. A final diagnostic is shown at
|
||||
verbosity level 1 or higher if any file fails the test when testing
|
||||
multiple files.
|
||||
|
||||
@item -v
|
||||
@itemx --verbose
|
||||
|
@ -364,12 +394,12 @@ Compression level. Set the compression parameters (dictionary size and
|
|||
match length limit) as shown in the table below. The default compression
|
||||
level is @samp{-6}, equivalent to @w{@samp{-s8MiB -m36}}. Note that
|
||||
@samp{-9} can be much slower than @samp{-0}. These options have no
|
||||
effect when decompressing, testing or listing.
|
||||
effect when decompressing, testing, or listing.
|
||||
|
||||
The bidimensional parameter space of LZMA can't be mapped to a linear
|
||||
scale optimal for all files. If your files are large, very repetitive,
|
||||
etc, you may need to use the @samp{--dictionary-size} and
|
||||
@samp{--match-length} options directly to achieve optimal performance.
|
||||
etc, you may need to use the options @samp{--dictionary-size} and
|
||||
@samp{--match-length} directly to achieve optimal performance.
|
||||
|
||||
If several compression levels or @samp{-s} or @samp{-m} options are
|
||||
given, the last setting is used. For example @w{@samp{-9 -s64MiB}} is
|
||||
|
@ -394,7 +424,7 @@ equivalent to @w{@samp{-s64MiB -m273}}
|
|||
Aliases for GNU gzip compatibility.
|
||||
|
||||
@item --loose-trailing
|
||||
When decompressing, testing or listing, allow trailing data whose first
|
||||
When decompressing, testing, or listing, allow trailing data whose first
|
||||
bytes are so similar to the magic bytes of a lzip header that they can
|
||||
be confused with a corrupt header. Use this option if a file triggers a
|
||||
"corrupt header" error and the cause is not indeed a corrupt header.
|
||||
|
@ -411,6 +441,19 @@ decompressing to non-seekable output. Increasing the number of packets
|
|||
may increase decompression speed, but requires more memory. Valid values
|
||||
range from 1 to 1024. The default value is 64.
|
||||
|
||||
@item --check-lib
|
||||
Compare the
|
||||
@uref{http://www.nongnu.org/lzip/manual/lzlib_manual.html#Library-version,,version of lzlib}
|
||||
used to compile plzip with the version actually being used at run time and
|
||||
exit. Report any differences found. Exit with error status 1 if differences
|
||||
are found. A mismatch may indicate that lzlib is not correctly installed or
|
||||
that a different version of lzlib has been installed after compiling plzip.
|
||||
@w{@samp{plzip -v --check-lib}} shows the version of lzlib being used and
|
||||
the value of @samp{LZ_API_VERSION} (if defined).
|
||||
@ifnothtml
|
||||
@xref{Library version,,,lzlib}.
|
||||
@end ifnothtml
|
||||
|
||||
@end table
|
||||
|
||||
Numbers given as arguments to options may be followed by a multiplier
|
||||
|
@ -438,16 +481,16 @@ caused plzip to panic.
|
|||
|
||||
|
||||
@node Program design
|
||||
@chapter Program design
|
||||
@chapter Internal structure of plzip
|
||||
@cindex program design
|
||||
|
||||
When compressing, plzip divides the input file into chunks and
|
||||
compresses as many chunks simultaneously as worker threads are chosen,
|
||||
creating a multimember compressed file.
|
||||
When compressing, plzip divides the input file into chunks and compresses as
|
||||
many chunks simultaneously as worker threads are chosen, creating a
|
||||
multimember compressed file.
|
||||
|
||||
When decompressing, plzip decompresses as many members simultaneously as
|
||||
worker threads are chosen. Files that were compressed with lzip will not
|
||||
be decompressed faster than using lzip (unless the @samp{-b} option was used)
|
||||
be decompressed faster than using lzip (unless the option @samp{-b} was used)
|
||||
because lzip usually produces single-member files, which can't be
|
||||
decompressed in parallel.
|
||||
|
||||
|
@ -492,6 +535,7 @@ when there is no longer anything to take away.@*
|
|||
|
||||
@sp 1
|
||||
In the diagram below, a box like this:
|
||||
|
||||
@verbatim
|
||||
+---+
|
||||
| | <-- the vertical bars might be missing
|
||||
|
@ -499,6 +543,7 @@ In the diagram below, a box like this:
|
|||
@end verbatim
|
||||
|
||||
represents one byte; a box like this:
|
||||
|
||||
@verbatim
|
||||
+==============+
|
||||
| |
|
||||
|
@ -513,6 +558,7 @@ The members simply appear one after another in the file, with no
|
|||
additional information before, between, or after them.
|
||||
|
||||
Each member has the following structure:
|
||||
|
||||
@verbatim
|
||||
+--+--+--+--+----+----+=============+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| ID string | VN | DS | LZMA stream | CRC32 | Data size | Member size |
|
||||
|
@ -532,8 +578,7 @@ Just in case something needs to be modified in the future. 1 for now.
|
|||
@anchor{coded-dict-size}
|
||||
@item DS (coded dictionary size, 1 byte)
|
||||
The dictionary size is calculated by taking a power of 2 (the base size)
|
||||
and subtracting from it a fraction between 0/16 and 7/16 of the base
|
||||
size.@*
|
||||
and subtracting from it a fraction between 0/16 and 7/16 of the base size.@*
|
||||
Bits 4-0 contain the base 2 logarithm of the base size (12 to 29).@*
|
||||
Bits 7-5 contain the numerator of the fraction (0 to 7) to subtract
|
||||
from the base size to obtain the dictionary size.@*
|
||||
|
@ -541,8 +586,8 @@ Example: 0xD3 = 2^19 - 6 * 2^15 = 512 KiB - 6 * 32 KiB = 320 KiB@*
|
|||
Valid values for dictionary size range from 4 KiB to 512 MiB.
|
||||
|
||||
@item LZMA stream
|
||||
The LZMA stream, finished by an end of stream marker. Uses default
|
||||
values for encoder properties.
|
||||
The LZMA stream, finished by an end of stream marker. Uses default values
|
||||
for encoder properties.
|
||||
@ifnothtml
|
||||
@xref{Stream format,,,lzip},
|
||||
@end ifnothtml
|
||||
|
@ -553,7 +598,7 @@ See
|
|||
for a complete description.
|
||||
|
||||
@item CRC32 (4 bytes)
|
||||
CRC of the uncompressed original data.
|
||||
Cyclic Redundancy Check (CRC) of the uncompressed original data.
|
||||
|
||||
@item Data size (8 bytes)
|
||||
Size of the uncompressed original data.
|
||||
|
@ -570,8 +615,8 @@ facilitates safe recovery of undamaged members from multimember files.
|
|||
@chapter Memory required to compress and decompress
|
||||
@cindex memory requirements
|
||||
|
||||
The amount of memory required @strong{per worker thread} for
|
||||
decompression or testing is approximately the following:
|
||||
The amount of memory required @strong{per worker thread} for decompression
|
||||
or testing is approximately the following:
|
||||
|
||||
@itemize @bullet
|
||||
@item
|
||||
|
@ -610,8 +655,7 @@ times the data size. Default is @w{142 MiB}.
|
|||
|
||||
@noindent
|
||||
The following table shows the memory required @strong{per thread} for
|
||||
compression at a given level, using the default data size for each
|
||||
level:
|
||||
compression at a given level, using the default data size for each level:
|
||||
|
||||
@multitable {Level} {Memory required}
|
||||
@item Level @tab Memory required
|
||||
|
@ -643,7 +687,7 @@ least as large as the number of worker threads times the chunk size
|
|||
compress, and compression will be proportionally slower. The maximum
|
||||
speed increase achievable on a given file is limited by the ratio
|
||||
@w{(file_size / data_size)}. For example, a tarball the size of gcc or
|
||||
linux will scale up to 8 processors at level -9.
|
||||
linux will scale up to 10 or 14 processors at level -9.
|
||||
|
||||
The following table shows the minimum uncompressed file size needed for
|
||||
full use of N processors at a given compression level, using the default
|
||||
|
@ -723,7 +767,7 @@ where a file containing trailing data must be rejected, the option
|
|||
WARNING! Even if plzip is bug-free, other causes may result in a corrupt
|
||||
compressed file (bugs in the system libraries, memory errors, etc).
|
||||
Therefore, if the data you are going to compress are important, give the
|
||||
@samp{--keep} option to plzip and don't remove the original file until you
|
||||
option @samp{--keep} to plzip and don't remove the original file until you
|
||||
verify the compressed file with a command like
|
||||
@w{@samp{plzip -cd file.lz | cmp file -}}. Most RAM errors happening during
|
||||
compression can only be detected by comparing the compressed file with the
|
||||
|
@ -732,8 +776,18 @@ contents, resulting in a valid compressed file containing wrong data.
|
|||
|
||||
@sp 1
|
||||
@noindent
|
||||
Example 1: Replace a regular file with its compressed version
|
||||
@samp{file.lz} and show the compression ratio.
|
||||
Example 1: Extract all the files from archive @samp{foo.tar.lz}.
|
||||
|
||||
@example
|
||||
tar -xf foo.tar.lz
|
||||
or
|
||||
plzip -cd foo.tar.lz | tar -xf -
|
||||
@end example
|
||||
|
||||
@sp 1
|
||||
@noindent
|
||||
Example 2: Replace a regular file with its compressed version @samp{file.lz}
|
||||
and show the compression ratio.
|
||||
|
||||
@example
|
||||
plzip -v file
|
||||
|
@ -741,8 +795,8 @@ plzip -v file
|
|||
|
||||
@sp 1
|
||||
@noindent
|
||||
Example 2: Like example 1 but the created @samp{file.lz} has a block
|
||||
size of @w{1 MiB}. The compression ratio is not shown.
|
||||
Example 3: Like example 1 but the created @samp{file.lz} has a block size of
|
||||
@w{1 MiB}. The compression ratio is not shown.
|
||||
|
||||
@example
|
||||
plzip -B 1MiB file
|
||||
|
@ -750,9 +804,8 @@ plzip -B 1MiB file
|
|||
|
||||
@sp 1
|
||||
@noindent
|
||||
Example 3: Restore a regular file from its compressed version
|
||||
@samp{file.lz}. If the operation is successful, @samp{file.lz} is
|
||||
removed.
|
||||
Example 4: Restore a regular file from its compressed version
|
||||
@samp{file.lz}. If the operation is successful, @samp{file.lz} is removed.
|
||||
|
||||
@example
|
||||
plzip -d file.lz
|
||||
|
@ -760,8 +813,8 @@ plzip -d file.lz
|
|||
|
||||
@sp 1
|
||||
@noindent
|
||||
Example 4: Verify the integrity of the compressed file @samp{file.lz}
|
||||
and show status.
|
||||
Example 5: Verify the integrity of the compressed file @samp{file.lz} and
|
||||
show status.
|
||||
|
||||
@example
|
||||
plzip -tv file.lz
|
||||
|
@ -769,29 +822,31 @@ plzip -tv file.lz
|
|||
|
||||
@sp 1
|
||||
@noindent
|
||||
Example 5: Compress a whole device in /dev/sdc and send the output to
|
||||
Example 6: Compress a whole device in /dev/sdc and send the output to
|
||||
@samp{file.lz}.
|
||||
|
||||
@example
|
||||
plzip -c /dev/sdc > file.lz
|
||||
plzip -c /dev/sdc > file.lz
|
||||
or
|
||||
plzip /dev/sdc -o file.lz
|
||||
@end example
|
||||
|
||||
@sp 1
|
||||
@anchor{concat-example}
|
||||
@noindent
|
||||
Example 6: The right way of concatenating the decompressed output of two
|
||||
or more compressed files. @xref{Trailing data}.
|
||||
Example 7: The right way of concatenating the decompressed output of two or
|
||||
more compressed files. @xref{Trailing data}.
|
||||
|
||||
@example
|
||||
Don't do this
|
||||
cat file1.lz file2.lz file3.lz | plzip -d
|
||||
cat file1.lz file2.lz file3.lz | plzip -d -
|
||||
Do this instead
|
||||
plzip -cd file1.lz file2.lz file3.lz
|
||||
@end example
|
||||
|
||||
@sp 1
|
||||
@noindent
|
||||
Example 7: Decompress @samp{file.lz} partially until @w{10 KiB} of
|
||||
Example 8: Decompress @samp{file.lz} partially until @w{10 KiB} of
|
||||
decompressed data are produced.
|
||||
|
||||
@example
|
||||
|
@ -800,8 +855,8 @@ plzip -cd file.lz | dd bs=1024 count=10
|
|||
|
||||
@sp 1
|
||||
@noindent
|
||||
Example 8: Decompress @samp{file.lz} partially from decompressed byte
|
||||
10000 to decompressed byte 15000 (5000 bytes are produced).
|
||||
Example 9: Decompress @samp{file.lz} partially from decompressed byte at
|
||||
offset 10000 to decompressed byte at offset 14999 (5000 bytes are produced).
|
||||
|
||||
@example
|
||||
plzip -cd file.lz | dd bs=1000 skip=10 count=5
|
||||
|
@ -820,7 +875,7 @@ for all eternity, if not longer.
|
|||
|
||||
If you find a bug in plzip, please send electronic mail to
|
||||
@email{lzip-bug@@nongnu.org}. Include the version number, which you can
|
||||
find by running @w{@code{plzip --version}}.
|
||||
find by running @w{@samp{plzip --version}}.
|
||||
|
||||
|
||||
@node Concept index
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue