Xref: utzoo comp.sys.ibm.pc:11263 comp.unix.questions:5403 comp.sys.att:2337 Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!mordor!sri-spam!rutgers!cmcl2!phri!manhat!mancol!samperi From: samperi@mancol.UUCP (Dominick Samperi) Newsgroups: comp.sys.ibm.pc,comp.unix.questions,comp.sys.att Subject: tar or cpio? Message-ID: <246@mancol.UUCP> Date: 1 Feb 88 02:22:13 GMT Organization: Manhattan College, NYC, USA Lines: 26 Keywords: tar,cpio,archivers 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@NYU.EDU ihnp4!cmcl2!manhat!samperi (cmcL2) ihnp4!cmcl2!phri!dasys1!samperi