Hi all,

Option -h is not working in tar 1.26. When creating a tar archive, if the file a symlink points to (let us call it "the original file") appears after the symlink, then, the original file can not be individually extracted from the tar file. Here you have the proof (Linux distribution is Fedora 16):

[root@localhost ~]# tar cvzhf test.tgz /etc/rc.d/init.d/httpd /etc/rc0.d/K15httpd
tar: Removing leading `/' from member names
/etc/rc.d/init.d/httpd
tar: Removing leading `/' from hard link targets
/etc/rc0.d/K15httpd
[root@localhost ~]# tar xvzf test.tgz etc/rc.d/init.d/httpd
etc/rc.d/init.d/httpd
[root@localhost ~]# tar cvzhf test.tgz /etc/rc0.d/K15httpd /etc/rc.d/init.d/httpd
tar: Removing leading `/' from member names
/etc/rc0.d/K15httpd
tar: Removing leading `/' from hard link targets
/etc/rc.d/init.d/httpd
[root@localhost ~]# tar xvzf test.tgz etc/rc.d/init.d/httpd
etc/rc.d/init.d/httpd
tar: etc/rc.d/init.d/httpd: Cannot hard link to `etc/rc0.d/K15httpd': No such file or directory
tar: Exiting with failure status due to previous errors
[root@localhost ~]#

If you need more tests, please, let me know.

Regards,

        Juan

Reply via email to