bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] Lzip support in GNU tar 1.23


From: Antonio Diaz Diaz
Subject: [Bug-tar] Lzip support in GNU tar 1.23
Date: Fri, 16 Oct 2009 11:58:42 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.11) Gecko/20050905

Hello Sergey,

Sergey Poznyakoff wrote:
Do you plan to auto-compress/recognize lzip files (.lz)?

No problem.  I'll only need some information on how to discern them
(e.g. by file header signature).  Do you have any pointers?

I see tar-1.22.90 does not yet mention lzip files anywhere. In case my last message was lost I send the pointers again.

File-5.00 (http://www.darwinsys.com/file/) recognizes lzip files. Here is the magic entry for lzip:

# lzip
0       string          LZIP            lzip compressed data
!:mime application/x-lzip
>4      byte            x               \b, version: %d


Also the lzip manual (http://www.nongnu.org/lzip/manual/lzip_manual.html#File-Format) describes the file format:

--------------------------------------------------------------------------
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.

`ID string'
    A four byte string, identifying the member type, with the value "LZIP".
`VN (version number, 1 byte)'
Just in case something needs to be modified in the future. Valid values are 0 and 1. Version 0 files have only one member and lack `Member size'.
`DS (coded dictionary size, 1 byte)'
    Bits 4-0 contain the base 2 logarithm of the base dictionary size.
Bits 7-5 contain the number of "wedges" to substract from the base dictionary size to obtain the dictionary size. The size of a wedge is (base dictionary size / 16).
    Valid values for dictionary size range from 4KiB to 512MiB.
`Lzma stream'
The lzma stream, finished by an end of stream marker. Uses default values for encoder properties.
`CRC32 (4 bytes)'
    CRC of the uncompressed original data.
`Data size (8 bytes)'
    Size of the uncompressed original data.
`Member size (8 bytes)'
Total size of the member, including header and trailer. This facilitates safe recovery of undamaged members from multimember files.
--------------------------------------------------------------------------

Thanks,
Antonio.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]