tar or cpio?

Tim Hitchcock twh at mibte.UUCP
Wed Feb 10 02:40:19 AEST 1988


> >I've heard that cpio will be used as the unix standard archiver, yet
> >many people seem to prefer tar. 
> >...
> 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):
> 
> 	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..)
> 

"cpio -u" will copy special files.

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

The "DD" command will swap bytes. In many cases find, cpio & dd are used.

> 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"

There is a limit to how many args are allowed on a command line.
There are many UNIX tools one can use to manipulate pathnames.
This seems to be resolved in the public domain tar (4).
> 	
> 	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.
> 	



More information about the Comp.sys.att mailing list