bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] TAR creates hard links or duplicated files inside archive


From: Paul Eggert
Subject: Re: [Bug-tar] TAR creates hard links or duplicated files inside archive when using -T option
Date: Mon, 05 Nov 2012 08:42:46 -0800
User-agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121028 Thunderbird/16.0.2

On 11/05/2012 06:56 AM, Joerg Schilling wrote:
> I was talking about the relation to a tar archive, not about the correct 
> interpretation inside a file system.

Tar archives don't have link counts;
file systems do, so I'm puzzled as to
why link counts are relevant for tar
archives.

> The indication for the existence of an additional
> hard link to a file is a link count > 1.

Yes, that's true for file systems.  But tar
archives don't have link counts, so this rule
does not apply to them.

Let's contrast Solaris tar ('tar' below)
with GNU tar ('gtar'):

$ touch a b
$ ln a alink
$ tar cf tar a a b b
$ tar tvf tar
tar: blocksize = 6
-rw-rw-r-- 5823/30       0 Nov  5 08:39 2012 a
-rw-rw-r-- 5823/30       0 Nov  5 08:39 2012 a linked to a
-rw-rw-r-- 5823/30       0 Nov  5 08:39 2012 b
-rw-rw-r-- 5823/30       0 Nov  5 08:39 2012 b
$ gtar cf tar a a b b
$ gtar tvf tar
-rw-rw-r-- eggert/faculty    0 2012-11-05 08:39 a
hrw-rw-r-- eggert/faculty    0 2012-11-05 08:39 a link to a
-rw-rw-r-- eggert/faculty    0 2012-11-05 08:39 b
hrw-rw-r-- eggert/faculty    0 2012-11-05 08:39 b link to b

Solaris tar treats A different from B, because there's
some other hard link in the file system that happens to
be the same as A, even though this other hard link has
nothing to do with tar's operands or operation.

GNU tar treats A and B consistently.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]