bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] dereferencing broken since 1.24?


From: Paul Eggert
Subject: Re: [Bug-tar] dereferencing broken since 1.24?
Date: Thu, 06 Jan 2011 09:28:45 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7

On 01/06/2011 06:28 AM, Michael Lawrence wrote:
> The above looks broken to me. The symlink becomes a hard link in the archive.

That's because, if you follow the symlink (which -h is supposed
to do), the the pointed-at file *is* a hard link.  The same thing
happens with ls's --dereference option.  For example:

$ touch foo
$ ln foo foo-hard
$ ln -s foo foo-soft
$ ls -il
total 0
2755582 -rw-r--r-- 2 eggert eggert 0 2011-01-06 09:21 foo
2755582 -rw-r--r-- 2 eggert eggert 0 2011-01-06 09:21 foo-hard
2755583 lrwxrwxrwx 1 eggert eggert 3 2011-01-06 09:21 foo-soft -> foo
$ ls -ilL
total 0
2755582 -rw-r--r-- 2 eggert eggert 0 2011-01-06 09:21 foo
2755582 -rw-r--r-- 2 eggert eggert 0 2011-01-06 09:21 foo-hard
2755582 -rw-r--r-- 2 eggert eggert 0 2011-01-06 09:21 foo-soft

tar -h is consistent with ls -L here:

$ tar cf - * | tar tvf -
-rw-r--r-- eggert/eggert     0 2011-01-06 09:21 foo
hrw-r--r-- eggert/eggert     0 2011-01-06 09:21 foo-hard link to foo
lrwxrwxrwx eggert/eggert     0 2011-01-06 09:21 foo-soft -> foo
$ tar chf - * | tar tvf -
-rw-r--r-- eggert/eggert     0 2011-01-06 09:21 foo
hrw-r--r-- eggert/eggert     0 2011-01-06 09:21 foo-hard link to foo
hrw-r--r-- eggert/eggert     0 2011-01-06 09:21 foo-soft link to foo

and this is true for both older tar (before 1.24) and newer tar.
If this behavior is "broken", then older GNU tar, Solaris tar, etc., are
also "broken", and "ls" is also "broken".  But they're not "broken":
they're following the symbolic link, which is what they're being asked
to do.



reply via email to

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