TAR/Gzip

From zedwiki

Jump to: navigation, search

Discussion

A TAR file (named from Tape ARchive) is the concatenation of one or more files, each preceded by a header block. The file data is written unaltered except that its length is rounded up to a multiple of 512 bytes and the extra space zero filled. The end of a TAR archive is marked by at least two consecutive zero-filled blocks. Files in a TAR archive are located by jumping from one header block to the next until the file is found. This is made possible by having the file size in the header block. Each header also contains a checksum of the header block. File name size is restricted to a maximum of 100 character.

TAR files are often compressed using GZIP and given the extension .TGZ. Such files then become one TAR file compressed with GZIP as opposed to multiple GZIP files archived in one TAR file.


The TAR File Header

Field Size Effect Field
0 100 File name
100 8 File mode
108 8 Owner user ID
116 8 Group user ID
124 12 File size in bytes (octal)
136 12 Last modification time
148 8 Check sum for header block
156 1 Link indicator
157 100 Name of linked file

References

Personal tools