.TH tp 1L "Mar 1995" .SH NAME tp \- extract/list the contents of a Unix tp archive .SH SYNOPSIS .B tp [ .B t|x ] .I filename .SH DESCRIPTION .B tp takes the filename of a Unix tp archive as its second argument, and either lists the contents of the archive, or extracts the contents of the archive to the current directory. The first argument is either a .B t or an .B x. .SH OPTIONS .TP .B t Produce a table of contents. .TP .B x Extract the archive's contents to the current directory. .SH ARCHIVE FORMAT A .I tp archive is broken up into a number of 512-byte blocks. Block 0 is unused. Block 1 begins the archive's table of contents. The table of contents is made up of a number of records with the following C structure: .PP .nf /* tp file entry */ struct tpdir { char pathname[32]; /* Filename of file */ uint16_t mode; /* Unix mode */ uint8_t uid; /* Owner of file */ uint8_t gid; /* Group of file */ char unused1; uint8_t size[3]; /* Size in bytes */ uint32_t modtime; /* Time of last modification */ uint16_t tapeaddr; /* Beginning block on tape */ char unused2[16]; uint16_t checksum; /* Checksum */ }; .fi .PP where .I uintXX_t indicates an unsigned integer .I XX bits wide. .PP The last record in the table of contents has a 0 in the first byte of the .I pathname string. All blocks following this block contain the files in the archive. The .I tapeaddr field in each file entry points to the first block which contains the data for that file. Files are stored contiguously. Where a file is not a multiple of the block-size in size, it is padded with bytes so that it is a integral number of blocks. .SH BUGS .B tp does not use the .I checksum field in the table of contents records. .PP .I mkdir -p is used to recursively make directory hierachies if they are needed. .SH "SEE ALSO" .BR tap (1L), .BR dtp (1L), .BR itp (1L), .BR mkdir (1) .SH AUTHOR Warren Toomey wkt@cs.adfa.edu.au