Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Apr 2018 22:20:23 -0600
From:      Gary Aitken <freebsd@dreamchaser.org>
To:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   tar xf foo -- how to restore symlink?
Message-ID:  <5ff313cf-6148-be90-0195-7d21f1f836ac@dreamchaser.org>

next in thread | raw e-mail | index | archive | help
I've got a tarball with an archived symlink and its contents.
The symlink points to another directory in the tarball, and the
tarball contains copies of the files in the symlinked directory.

A normal extract fails with the message:
$ tar -xf nufraw-0.41.tar.gz
nufraw-0.41/doc-pak: Can't replace existing directory with non-directory

What's the right way to deal with this?

How do I get tar to restore the symlink as a symlink?
   -k and --exclude allow tar to continue unpacking,
   but don't restore the symlink as such.

"man tar" doesn't seem to have what I want but I'm probably blind.

Thanks,

Gary



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5ff313cf-6148-be90-0195-7d21f1f836ac>