.TH dtp 1L "Mar 1995" .SH NAME dtp \- extract/list the contents of a Unix dtp archive .SH SYNOPSIS .B dtp [ .B t|x ] .I filename .SH DESCRIPTION .B dtp takes the filename of a Unix dtp 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 dtp archive is broken up into a number of 512-byte blocks. Block 0 contains the offset of the actual files' data, stored in a uint16_t at bytes 6 and 7. This value is converted to an offset in bytes as follows: .PP .nf offset = 64 * (256 * byte[6] + byte[7]); .fi .PP 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 /* dtp tape directory entry */ struct tpdir { char pathname[114]; /* Filename of file */ uint16_t mode; /* Unix mode */ uint8_t uid; /* Owner of file */ uint8_t gid; /* Group of file */ uint8_t unused1; uint8_t size[3]; /* Size in bytes */ uint8_t modtime[4]; /* Time of last modification */ uint16_t tapeaddr; /* Beginning block on tape */ }; .fi .PP where .I uintXX_t indicates an unsigned integer .I XX bits wide. .PP The table of contents extends from Block 1 up to the data offset calculated above. Alternatively, the last record in the table of contents may be indicated by 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 after the offset 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 dtp 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 tp (1L), .BR itp (1L), .BR mkdir (1) .SH AUTHOR Warren Toomey wkt@cs.adfa.edu.au