.TH tap 1L "Mar 1995"
.SH NAME
tap \- extract/list the contents of a Unix tap archive
.SH SYNOPSIS
.B tap epoch
[
.B t|x
] 
.I filename
.SH DESCRIPTION
.B tap
takes the filename of a Unix tap archive as its third argument, and either
lists the contents of the archive, or extracts the contents of the archive
to the current directory. The first argument sets the epoch for the archive,
and is one of the integers 71, 72 or 73. These mean Jan 1 of the years 1971,
1972 or 1973, respectively. The second 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 tap
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
/* tap tape directory entry */
struct tapdir {
    char pathname[32];                          /* Filename of file */
    uint8_t mode;                               /* 1st Edition mode */
    uint8_t uid;                                /* Owner of file */
    uint16_t size;                              /* Size in bytes */
    uint32_t modtime;                           /* Time of last modification */
    uint16_t tapeaddr;                          /* Beginning block on tape */
    char unused2[20];
    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 tap
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 ntap (1L),
.BR tp (1L),
.BR dtp (1L),
.BR itp (1L),
.BR mkdir (1)
.SH AUTHOR
Warren Toomey wkt@cs.adfa.edu.au