In the GNU specs for POSIX tar archive format here, the header structure is defined as:
struct posix_header
{ /* byte offset */
char name[100]; /* 0 */
char mode[8]; /* 100 */
char uid[8]; /* 108 */
char gid[8]; /* 116 */
char size[12]; /* 124 */
char mtime[12]; /* 136 */
char chksum[8]; /* 148 */
char typeflag; /* 156 */
char linkname[100]; /* 157 */
char magic[6]; /* 257 */
char version[2]; /* 263 */
char uname[32]; /* 265 */
char gname[32]; /* 297 */
char devmajor[8]; /* 329 */
char devminor[8]; /* 337 */
char prefix[155]; /* 345 */
/* 500 */
};
The size
field of the header is defined as a char array of length 12, and the byte length of the field appears to be 12 bytes (inferred by the byte offset comment). This in theory provides 12 bytes (=96 bits) of space to store an unsigned integer. However, I suspect this is not the case.
- Is the max size value equal to just 12 digits (999,999,999,999)? Or
- Since this size value represents the number of bytes in the file, does that mean the size value might not be completely accurate since the data size might equal a number of bits that isn't divisible by 8? Or do files always get saved in increments of 8 bits (with unused bits padded out to fill an entire byte), and thus the data length of bits will always be divisible by 8?