Article View: comp.std.unix
Article #1058Re: tar vs. cpio
From: Henry Spencer
Date: Wed, 24 Jun 1987 00:56
Date: Wed, 24 Jun 1987 00:56
27 lines
1720 bytes
1720 bytes
From: henry@utzoo.UUCP (Henry Spencer)
As a counterpoint to Kenneth Almquist's example of tar fouling up links,
try the following:
echo hi >one
ln one two
ls one two | cpio -o >/tmp/foo
rm one two
cpio -i one </tmp/foo
cpio -i two </tmp/foo
Now we have cpio creating two files where there was supposed to be only one
with two links. Note that tar would get this one right! (Although you would
have to be careful to get the order right, admittedly a wart.)
The moral of the story is that it is very hard to handle links properly in
a format like tar or cpio, and *neither* of the existing formats is bullet-
proof in the presence of links. This is not a valid argument for or against
either format; they merely screw up in different ways. One can argue about
the relative probabilities of the different screwup types causing trouble,
but I think the point is made.
Henry Spencer @ U of Toronto Zoology
{allegra,ihnp4,decvax,pyramid}!utzoo!henry
Volume-Number: Volume 11, Number 79
Technical Details
Message-ID:
<8362@ut-sally.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!ut-sally!std-unixReferences:
<8188@ut-sally.UUCP> <8208@ut-sally.UUCP> <8249@ut-sally.UUCP>, <8276@ut-sally.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!ut-sally!std-unix From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: comp.std.unix Subject: Re: tar vs. cpio Message-ID: <8362@ut-sally.UUCP> Date: Tue, 23-Jun-87 20:56:16 EDT Article-I.D.: ut-sally.8362 Posted: Tue Jun 23 20:56:16 1987 Date-Received: Tue, 30-Jun-87 06:46:55 EDT References: <8188@ut-sally.UUCP> <8208@ut-sally.UUCP> <8249@ut-sally.UUCP>, <8276@ut-sally.UUCP> Sender: std-unix@ut-sally.UUCP Reply-To: henry@utzoo.UUCP (Henry Spencer) Lines: 27 Approved: jsq@sally.utexas.edu (Moderator, John Quarterman) Summary: Cpio format makes correct handling of links impossible, too.