tar or cpio?

Marc W. Mengel mmengel at cuuxb.ATT.COM
Thu Feb 4 01:47:32 AEST 1988


In article <246 at mancol.UUCP> samperi at mancol.UUCP (Dominick Samperi) writes:
>I've heard that cpio will be used as the unix standard archiver, yet
>many people seem to prefer tar. 
>...
>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.

Well, you missed (about 1 month ago) a LONG discussion (TAR WARS (-:) in
comp.std.unix, which can be summarized (this off the top of my head, so
I won't try to credit the appropriate folks) as follows (tar and cpio
here refer to  their respective archive formats):

	1) There is much confusion as to whether tar or cpio is older.

	2) tar implementations are more prevalent (almost every release has 
		some version of tar, many (i.e. the BSD releases and 
		v7 derivatives) do not have any version of cpio)

	3) tar format is easily extensible to handle special files such as
		device nodes, named pipes, etc. and has been so extended
		in the public domain version of tar (posted many months
		ago in comp.sources and a PC version about 2 months ago..)

	4) cpio assumes too many things about inode numbers, (limiting their 
		range, etc.)

	5) non-character format cpio archives are not easily moveable to
		machines with different byte ordering.

	6) cpio builds in information to handle file links properly
		regardless of file extraction order. (however it
		uses inode numbers to do this, see (4)

As to the command format

	1) taking files on stdin is more convenient for backups (used
		with find(1))
	
	2) taking files as arguments is more convenient for archives
		constructed "by hand"
	
	3) cpio will copy directory trees with an option, tar needs
		2 tar's in a pipeline to do this.
		
	4) points 1 and 2 are resolved in the public domain tar  (it
		has an option to read filenames from stdin.)

These were the points discussed, and the tar format has been chosen (as
of the last I heard) for the POSIX (a.k.a IEEE 1003) standard.
	
>Dominick Samperi, Manhattan College, NYC


-- 
 Marc Mengel	

 attmail!mmengel
 ...!{moss|lll-crg|mtune|ihnp4}!cuuxb!mmengel



More information about the Comp.unix.questions mailing list