|
|
1.1 ! root 1: .TH TAR 5 "15 January 1983" ! 2: .SH NAME ! 3: tar \- tape archive file format ! 4: .SH DESCRIPTION ! 5: .IR Tar , ! 6: (the tape archive command) ! 7: dumps several files into one, in a medium suitable for transportation. ! 8: .PP ! 9: A ``tar tape'' or file is a series of blocks. Each block is of size TBLOCK. ! 10: A file on the tape is represented by a header block which describes ! 11: the file, followed by zero or more blocks which give the contents of the ! 12: file. At the end of the tape are two blocks filled with binary ! 13: zeros, as an end-of-file indicator. ! 14: .PP ! 15: The blocks are grouped for physical I/O operations. Each group of ! 16: .I n ! 17: blocks (where ! 18: .I n ! 19: is set by the ! 20: .B b ! 21: keyletter on the ! 22: .IR tar (1) ! 23: command line \(em default is 20 blocks) is written with a single system ! 24: call; on nine-track tapes, the result of this write is a single tape ! 25: record. The last group is always written at the full size, so blocks after ! 26: the two zero blocks contain random data. On reading, the specified or ! 27: default group size is used for the ! 28: first read, but if that read returns less than a full tape block, the reduced ! 29: block size is used for further reads. ! 30: .PP ! 31: The header block looks like: ! 32: .RS ! 33: .PP ! 34: .nf ! 35: #define TBLOCK 512 ! 36: #define NAMSIZ 100 ! 37: ! 38: union hblock { ! 39: char dummy[TBLOCK]; ! 40: struct header { ! 41: char name[NAMSIZ]; ! 42: char mode[8]; ! 43: char uid[8]; ! 44: char gid[8]; ! 45: char size[12]; ! 46: char mtime[12]; ! 47: char chksum[8]; ! 48: char linkflag; ! 49: char linkname[NAMSIZ]; ! 50: } dbuf; ! 51: }; ! 52: .ta \w'#define 'u +\w'SARMAG 'u ! 53: .fi ! 54: .RE ! 55: .LP ! 56: .IR Name ! 57: is a null-terminated string. ! 58: The other fields are zero-filled octal numbers in ASCII. Each field ! 59: (of width w) contains w-2 digits, a space, and a null, except ! 60: .IR size ! 61: and ! 62: .IR mtime , ! 63: which do not contain the trailing null. ! 64: .IR Name ! 65: is the name of the file, as specified on the ! 66: .I tar ! 67: command line. Files dumped because they were in a directory which ! 68: was named in the command line have the directory name as prefix and ! 69: .I /filename ! 70: as suffix. ! 71: . \"Whatever format was used in the command line ! 72: . \"will appear here, such as ! 73: . \".I \&./yellow ! 74: . \"or ! 75: . \".IR \&../../brick/./road/.. . ! 76: . \"To retrieve a file from a tar tape, an exact prefix match must be specified, ! 77: . \"including all of the directory prefix information used on the command line ! 78: . \"that dumped the file (if any). ! 79: .IR Mode ! 80: is the file mode, with the top bit masked off. ! 81: .IR Uid ! 82: and ! 83: .IR gid ! 84: are the user and group numbers which own the file. ! 85: .IR Size ! 86: is the size of the file in bytes. Links and symbolic links are dumped ! 87: with this field specified as zero. ! 88: .IR Mtime ! 89: is the modification time of the file at the time it was dumped. ! 90: .IR Chksum ! 91: is a decimal ASCII value which represents the sum of all the bytes in the ! 92: header block. When calculating the checksum, the ! 93: .IR chksum ! 94: field is treated as if it were all blanks. ! 95: .IR Linkflag ! 96: is ASCII `0' if the file is ``normal'' or a special file, ASCII `1' ! 97: if it is an hard link, and ASCII `2' ! 98: if it is a symbolic link. The name linked-to, if any, is in ! 99: .IR linkname, ! 100: with a trailing null. ! 101: Unused fields of the header are binary zeros (and are included in the ! 102: checksum). ! 103: .PP ! 104: The first time a given i-node number is dumped, it is dumped as a regular ! 105: file. The second and subsequent times, it is dumped as a link instead. ! 106: Upon retrieval, if a link entry is retrieved, but not the file it was ! 107: linked to, an error message is printed and the tape must be manually ! 108: re-scanned to retrieve the linked-to file. ! 109: .PP ! 110: The encoding of the header is designed to be portable across machines. ! 111: .SH "SEE ALSO" ! 112: tar(1) ! 113: .SH BUGS ! 114: Names or linknames longer than NAMSIZ produce error reports and cannot be ! 115: dumped.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.