General Information about Archives - ntruessel/etar GitHub Wiki

Archives

An archive is a file that combines multiple files (including metadata) in one single file. Compression is possible but not necessary. The etar library uses tar-style layout for its archives. This section contains a tiny summary of how the tar format generally looks like:

An archive ultimately is a series of blocks, each block consisting of 512 bytes. The last two blocks indicate the end of the archive and contain only zero bytes. All other blocks form entries. An entry consists of exactly one header block, followed by zero or more payload blocks. The exact number of payload blocks depends on the contents of the header block.

Archive Schematic

Header blocks

Header blocks contain metadata about the following payload blocks, like for example:

  • filename
  • type (directory, regular file, ...)
  • owner name

and more. For a detailed description of the header format see the corresponding section in the pax specification