-
Notifications
You must be signed in to change notification settings - Fork 3
/
FORMAT
64 lines (49 loc) · 2.57 KB
/
FORMAT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
All formats start with a common header line, and then proceed with an index
line for each tar record. Different index versions have different fields in
the index lines, but in all cases the index fields are separated by a single
space character, until the filename field is reached, which continues until
the newline.
Starting with version 1.0.7, after the header line there may also be lines
starting with a #, which are treated as comments and ignored. The comment
line recognition is very strict right now, there must be no whitespace
before the # sign. Also comments at the end of an index line are not
allowed, they must be on a line by themselves.
The header line:
TARIX INDEX v<indexver> GENERATED BY <program and ver>
Current format: v2
<headerline>
<recordtype> <512 offset> <actual offset> <512 length> <filename>
The v2 format combines the v1 and v0 formats, and adds a type field to aid
especially in using the index for a FUSE mount. The record type field is
the type field from the tar header (special care must be taken in the case
of long filename and long link content records). The other fields are the
same as in the v1 format, with one caveat. The v1 format was only valid for
zlib processed archives, esp. concerning the actual offset field. In the v2
format, for non-zlib archives, the actual offset is simply the byte offset
in the archive where the record starts, and thus should be exactly
512*512offset.
In the case of archive items that are preceded by associated LONGLINK and/or
LONGNAME records, the recordtype is for the actual archive item, the offsets
are for the first record associated with the archive item (a LONG* record),
and the length is the total number of blocks, including all header, LONG*,
and file data records.
Old Formats:
The v1 format:
<headerline>
<512offset> <actual offset> <512length> <filename>
...
The v1 format follows the same basic form as the v0 one. The actual offset
is the real offset in the output stream where the zlib checkpoint was
placed. A zlib reset and seek to this address will allow decompression to
resume at the 512offset of that file.
The v0 format:
<headerline>
<512offset> <512length> <filename>
...
The data lines:
Each data line is the 512-block offset in the tar archive in decimal, the
number of 512-blocks used by that file (not the same as the file length, but
how many blocks to seek forward to get to the next record, or how many
blocks to read out to get only that file), followed by the filename, and
then a newline. 512-blocks means that byte offset 512 in the tar archive
would be represented by a 512-offset of 1.