[net.unix] tar .vs. cpio -- flame!

henry@utzoo.UUCP (Henry Spencer) (08/13/84)

> ......................................................  Tar comes from
> Berkeley and cpio from Bell (now AT&T)...

Wrong, tar comes from the authors of Unix (the Murray Hill research lab),
while cpio comes from the wonderful people who brought you PWB (retch).

> ..............They grew up to solve different problems.  Tar is a "tape
> archiver" and its major function is to produce backups of filesystems.
> (This was in the days when a filesystem would fit on a single tape.)

Wrong again, both tar and the older tp were for exchanging data on tapes.
Dump and restor are the backup utilities.

> ..... cpio was designed from the ground up to solve a very different
> problem -- selectivly copying lists of files (actually, filesystem elements).
> Thus, it is useful for distributions, or for copying recently-changed files
> for backup, or for copying a selected part of a directory tree somewhere
> else, or .....

These are among the things tar is used for, albeit not as easily as cpio
for some of them.

> Tar takes its list of files from the command line, effectivly
> limiting the number of arguments, while cpio takes them from the standard
> input, giving no such limitation...

Quite true, but it's not hard to add such a facility to tar.  It would
have been very easy to do this, instead of going with an incompatible
format.  (I know that cpio pre-dates tar; that's no excuse for perpetuating
it, though.)

> ....Philosophy.  Cpio is more in keeping with the Unix (tm) philosophy,
> since it seperates the job of SELECTING the files from the job of COPYING
> the files...

See previous comment on the ease of adding this facility to tar.  Actually,
cpio is quite in keeping with the philosophy of the PWB/SysIII/SysV folks,
which is never to adopt an existing program if they can write something else
(incompatible, of course) themselves.  Unix philosophy?  They've never heard
of it!
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry

karl@twg.UUCP (Karl Auerbach) (08/14/84)

When discussing software it is unfair to make a statement such as:
   "it would be easy to add X"  or  "it would be easy to modify X to do Y".

We need to deal with concrete, existing entities.  Otherwise the discussion
becomes too metaphysical.

The point is that cpio and tar do some things that are similar and some
which are not.  Rather than saying that one is better than the other because
it can be modified to include the good points of the other, we could 
identify the strengths and weaknesses of each program and perhaps
make a choice of which program to upgrade.

Karl Auerbach
{allegra,fortune,decwrl,ihnp4,ucbvax}!twg!karl