From owner-freebsd-current@FreeBSD.ORG Wed Mar 30 11:39:51 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 2892D16A4D2 for ; Wed, 30 Mar 2005 11:39:51 +0000 (GMT) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6277543D31 for ; Wed, 30 Mar 2005 11:39:50 +0000 (GMT) (envelope-from smckay@internode.on.net) Received: from dungeon.home (ppp116-118.lns1.bne3.internode.on.net [59.167.116.118])j2UBdjYM032171; Wed, 30 Mar 2005 21:09:45 +0930 (CST) Received: from dungeon.home (localhost [127.0.0.1]) by dungeon.home (8.13.1/8.11.6) with ESMTP id j2UBdMp5016442; Wed, 30 Mar 2005 21:39:22 +1000 (EST) (envelope-from mckay) Message-Id: <200503301139.j2UBdMp5016442@dungeon.home> To: freebsd-current@freebsd.org References: <20050327223238.GA749@polands.org> <010401c53385$584a04c0$6800000a@venti> <20050329041527.GA9586@VARK.MIT.EDU> <20050329062550.GA69824@cirb503493.alcatel.com.au> In-Reply-To: <20050329062550.GA69824@cirb503493.alcatel.com.au> from Peter Jeremy at "Tue, 29 Mar 2005 06:25:51 +0000" Date: Wed, 30 Mar 2005 21:39:22 +1000 From: Stephen McKay cc: Peter Jeremy cc: "Brian K. White" cc: Stephen McKay 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: Wed, 30 Mar 2005 11:39:51 -0000 On Tuesday, 29th March 2005, Peter Jeremy wrote: >Brian missed a pair of parenthenis. The example should read: > >( cd srcdir ; tar cf - . ) | ( cd destdir ; tar xpf - ) Tar is indeed a most excellent program for copying directory trees, since even in this modern century cp fails to correctly handle hard links. Sigh. Still, if you are using tar, be sure to use it correctly: ( cd srcdir && tar cf - . ) | ( cd destdir && tar xpf - ) You don't want it going off in the current directory and mangling things just because of a little typo in a directory name. Stephen. PS If I'm right, the new tar fixes something gtar got wrong: setting permissions on "." when it is part of the archive, which of course it is when you copy directories in this way. This may surprise new users, even though it is the only sensible result. PPS Who's for adding a "cp -h" option to copy preserving hard links?