This manual is for Plzip (version 1.0-rc1, 8 March 2013).
Copyright © 2009, 2010, 2011, 2012, 2013 Antonio Diaz Diaz.
This manual is free documentation: you have unlimited permission to copy, distribute and modify it.
Plzip is a massively parallel (multi-threaded), lossless data compressor based on the lzlib compression library, with very safe integrity checking and a user interface similar to the one of bzip2, gzip or lzip. Plzip uses the lzip file format; the files produced by plzip are fully compatible with lzip-1.4 or newer, and can be rescued with lziprecover.
Plzip is intended for faster compression/decompression of big files on multiprocessor machines, which makes it specially well suited for distribution of big software files and large scale data archiving. On files big enough, plzip can use hundreds of processors.
Plzip replaces every file given in the command line with a compressed version of itself, with the name "original_name.lz". Each compressed file has the same modification date, permissions, and, when possible, ownership as the corresponding original, so that these properties can be correctly restored at decompression time. Plzip is able to read from some types of non regular files if the `--stdout' option 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 correctly decompress a file which is the concatenation of two or more compressed files. The result is the concatenation of the corresponding uncompressed files. Integrity testing of concatenated compressed files is also supported.
When decompressing, plzip attempts to guess the name for the decompressed file from that of the compressed file as follows:
As a self-check for your protection, plzip stores in the member trailer the 32-bit CRC of the original data and the size of the original data, to make sure that the decompressed version of the data is identical to the original. This guards against corruption of the compressed data, and against undetected bugs in plzip (hopefully very unlikely). The chances of data corruption going undetected are microscopic, less than one chance in 4000 million for each member processed. Be aware, though, that the check occurs upon decompression, so it can only tell you that something is wrong. It can't help you recover the original uncompressed data.
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 is important, give the `--keep' option to plzip and do not remove the original file until you verify the compressed file with a command like `plzip -cd file.lz | cmp file -'.
Return values: 0 for a normal exit, 1 for environmental problems (file not found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or invalid input file, 3 for an internal consistency error (eg, bug) which caused plzip to panic.
For each input file, a splitter thread and several worker threads are created, acting the main thread as muxer (multiplexer) thread. A "packet courier" takes care of data transfers among threads and limits the maximum number of data blocks (packets) being processed simultaneously.
The splitter reads data blocks from the input file, and distributes them to the workers. The workers (de)compress the blocks received from the splitter. The muxer collects processed packets from the workers, and writes them to the output file.
When decompressing from a regular file, the splitter is removed and the workers read directly from the input file. If the output file is also a regular file, the muxer is also removed, and the workers write directly to the output file. With these optimizations, decompression speed of large files with many members is only limited by the number of processors available and by I/O speed.
The format for running plzip is:
plzip [options] [files]
Plzip supports the following options:
For maximum compression you should use a dictionary size limit as large
as possible, but keep in mind that the decompression memory requirement
is affected at compression time by the choice of dictionary size limit.
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 `--match-length' and `--dictionary-size' options directly to achieve optimal performance.
|Level||Dictionary size||Match length limit
|-1||1 MiB||5 bytes
|-2||1.5 MiB||6 bytes
|-3||2 MiB||8 bytes
|-4||3 MiB||12 bytes
|-5||4 MiB||20 bytes
|-6||8 MiB||36 bytes
|-7||16 MiB||68 bytes
|-8||24 MiB||132 bytes
|-9||32 MiB||273 bytes
Numbers given as arguments to options may be followed by a multiplier and an optional `B' for "byte".
Table of SI and binary prefixes (unit multipliers):
|k||kilobyte (10^3 = 1000)|||||Ki||kibibyte (2^10 = 1024)
|M||megabyte (10^6)|||||Mi||mebibyte (2^20)
|G||gigabyte (10^9)|||||Gi||gibibyte (2^30)
|T||terabyte (10^12)|||||Ti||tebibyte (2^40)
|P||petabyte (10^15)|||||Pi||pebibyte (2^50)
|E||exabyte (10^18)|||||Ei||exbibyte (2^60)
|Z||zettabyte (10^21)|||||Zi||zebibyte (2^70)
|Y||yottabyte (10^24)|||||Yi||yobibyte (2^80)
Perfection is reached, not when there is no longer anything to add, but
when there is no longer anything to take away.
— Antoine de Saint-Exupery
In the diagram below, a box like this:
+---+ | | <-- the vertical bars might be missing +---+
represents one byte; a box like this:
+==============+ | | +==============+
represents a variable number of bytes.
A lzip file consists of a series of "members" (compressed data sets). 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:
+--+--+--+--+----+----+=============+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ID string | VN | DS | Lzma stream | CRC32 | Data size | Member size | +--+--+--+--+----+----+=============+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
All multibyte values are stored in little endian order.
There are probably bugs in plzip. There are certainly errors and omissions in this manual. If you report them, they will get fixed. If you don't, no one will ever know about them and they will remain unfixed for all eternity, if not longer.
If you find a bug in plzip, please send electronic mail to email@example.com. Include the version number, which you can find by running `plzip --version'.