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.