BasKet Archive file format

The BasKet file format (.baskets) is a structure which wraps a compressed tar and a preview image. The latest archive format version is 0.6.1.

File Structure

The archive file is divided into the structures: file header, preview image header, a preview image (.png), archive header, and a gunzipped tar archive (.tar.gz) containing a baskets file tree as illustrated in the following sketch

Archive file header

The file header is a short structure, consisting of lines of strings, the file declarator, and the format version

The first 17 bytes contain the literal string BasKetNP:archive followed by a new line feed symbol (0x0A) in ISO-8859-1 encoding.

The second string is a literal string version:0.6.1 followed by a line feed symbol (0x0A) in ISO-8859-1 encoding.

An example:

								
BasKetNP:archive
version:0.6.1
									
							

Preview image header

Currently, the basket archive file contains a preview file which is derived from the first basket's content.

Directly following the file header, a literal string preview*:<size> in ISO-8859-1 encoding, again followed by a line feed symbol. The parameter <size> is a string of decimal numbers. It declares the size in bytes of the preview image. <size> is of type unsigned long.

An example:

								
preview*:12000
									
							

Preview image file

The preview image is of type .png. Its size is specified by the preview image header. The preview image file is inserted as file stream, and directly follows the preview image header.

BasKet content archive header

Just like for the preview image file, the content archive is preceded by a string specifying its size. That string directly follows the file stream of the archive.

That string must be archive*:<size> followed by a line feed symbol, in ISO-8869-1 encoding. The parameter <size> is a unsigned long integer in string format.

An example:

								
archive*:1245000
									
							

BasKet content archive

The content archive contains the BasKet file tree compressed in to a gzipped tar archive (.tar.gz). Its size is specified by the content header.

Example byte stream

The following table shows key parts of the basket archive file content. The left column specifies the offset in the file stream. The center column gives the byte stream at the current offset in hexadecimal format. The right column shows printable characters within the file stream at the current offset.