On 11/02/2012 09:29 AM, Joerg Schilling wrote:
> this should not happen when the file has a linkcount == 1

I don't see why not.  There are two instances of the file
in the archive, at the user's request, and they are the
same file, so one should be a hard link to the other.

Solaris 'tar' behaves differently.  If you do this:

  $ touch x
  $ tar cf f x x

it creates an archive with two copies of 'x'.  If you do this
instead:

  $ touch x
  $ ln x y
  $ tar cf f x x

it creates an archive with one copy, and a hard link, which
is what GNU tar does in both cases.  GNU tar is more consistent,
since it behaves the same regardless of whether the file happens
to have hard links somewhere else in the file system (something
that should not affect what archive is produced).

Reply via email to