On Wed, Jan 5, 2011 at 1:09 PM, Joerg Schilling
<address@hidden> wrote:
> > What is bar in the first case?
> >
> >
> Sorry, somehow this:
>
> $ ln -s foo bar
>
> Got lost in the cut and paste.
In that case, I would expect tar to detect a hard link between foo and bar in
case that -h is used, but carefully read the rest to understand the full
background.
Specifying -h results in using stat() instead of lstat() and this makes it
impossible for tar to distinct between foo and bar as both files return the
same stat() structure.
However, tar does not asume a hard link in case that the link count for foo is
less than two.
For this reason, something like:
0 -rw-r--r-- root/bs Jan 5 22:01 2011 foo
0 -rw-r--r-- root/bs Jan 5 22:01 2011 bar
is the expected result in case that foo has no other hard links.
Ok. I'm a little confused by this response. If I understand you correctly, with -h there should be no links within the archive, i.e., there are two copies of foo in the archive. This is not how tar >= 1.24 behaves.
Thanks,
Michael