From owner-freebsd-current@FreeBSD.ORG Tue Mar 29 10:55:16 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3BED116A4CE for ; Tue, 29 Mar 2005 10:55:16 +0000 (GMT) Received: from mail11.syd.optusnet.com.au (mail11.syd.optusnet.com.au [211.29.132.192]) by mx1.FreeBSD.org (Postfix) with ESMTP id 84F5143D1D for ; Tue, 29 Mar 2005 10:55:15 +0000 (GMT) (envelope-from PeterJeremy@optushome.com.au) Received: from cirb503493.alcatel.com.au (c211-30-75-229.belrs2.nsw.optusnet.com.au [211.30.75.229]) j2TAsrYJ017576 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Tue, 29 Mar 2005 20:54:54 +1000 Received: from cirb503493.alcatel.com.au (localhost.alcatel.com.au [127.0.0.1])j2TAsr7l070075; Tue, 29 Mar 2005 20:54:53 +1000 (EST) (envelope-from pjeremy@cirb503493.alcatel.com.au) Received: (from pjeremy@localhost)j2TAspuJ070074; Tue, 29 Mar 2005 20:54:51 +1000 (EST) (envelope-from pjeremy) Date: Tue, 29 Mar 2005 20:54:51 +1000 From: Peter Jeremy To: Danny Braniss Message-ID: <20050329105450.GC69824@cirb503493.alcatel.com.au> References: <12938.1112080352@bizet.nethelp.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2i cc: brian@aljex.com cc: freebsd-current@freebsd.org cc: sthaug@nethelp.no Subject: Re: Heads up: gtar gone from base system X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2005 10:55:16 -0000 On Tue, 2005-Mar-29 09:36:18 +0200, Danny Braniss wrote: >> > Brian missed a pair of parenthenis. The example should read: >> > >> > ( cd srcdir ; tar cf - . ) | ( cd destdir ; tar xpf - ) >> >> All the first perens does is leave you sitting wherever you were before >> starting, whereas my example would have left you sitting in srcdir. >> It makes no functional difference in the tar/untar job itself. It makes a significant difference if "destdir" is relative. >> same everywhere. I do it on Linux and FreeBSD too and I just verified on a >> 5.3 box just to make sure instead of relying on memory and common sense. >> It's still in my fingers too, used it for many years. Lately I have >> been using cp -pR for the same job. > >caution: > -R If source_file designates a directory, cp copies the directory and > the entire subtree connected at that point. This option also > causes symbolic links to be copied, rather than indirected through, > and for cp to create special files rather than copying them as nor- > mal files. Created directories have the same mode as the corre- > sponding source directory, unmodified by the process' umask. >****************************************************************************** > Note that cp copies hard linked files as separate files. If you > need to preserve hard links, consider using tar(1), cpio(1), or > pax(1) instead. >****************************************************************************** At work, we have a development toolchain which creates symlinks of the form "gui -> ." within its output trees and I regularly have to remind people not to use "cp -pR" (or samba) to copy the trees. I usually use "tar|tar" or "find|cpio" for tree copying. The latter has the option of being able to hardlink the files instead of copying them. -- Peter Jeremy