tar or cpio?

Dominick Samperi samperi at mancol.UUCP
Mon Feb 1 12:22:13 AEST 1988


I've heard that cpio will be used as the unix standard archiver, yet
many people seem to prefer tar. While implementing these programs on
a PC I noticed several advantages/disadvantages of each. In a tar
archive, file headers and file data always begin on a block (512 byte)
boundary, thus making it easier to seek to the beginning of a particular
file, or to append files to a tar archive. On the other hand, files in
a cpio archive can begin at any byte (character format), so a file header
could even span two volumes (floppies), making it difficult to append files
to a cpio archive. It seems that directories and special device files cannot
be written to a tar archive (on the unix systems that I checked), while they
can be written to a cpio archive. This means that more information is stored
in a cpio archive, thus facilitating file restores after a crash. Another
disadvantage of tar archives is the fact that they tend to waste space, since
every file must occupy at lease 1K bytes (512 for a header, and 512 for data).

I'd be interested to hear about any published standards for tar and/or
cpio (AT&T, POSIX, etc.), especially standards that define how to deal
with multi-volume archives (e.g., how do you start reading starting at
volume N?). Perhaps people can add to the list of advantages/disadvantages
of tar and cpio. Differences in the user interface (command syntax) is not
really important, since tar can be used like cpio, and vis versa, via
shell scripts.

-- 
Dominick Samperi, Manhattan College, NYC
	manhat!samperi at NYU.EDU  ihnp4!cmcl2!manhat!samperi (cmcL2)
	ihnp4!cmcl2!phri!dasys1!samperi



More information about the Comp.sys.att mailing list