From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 31 13:21:08 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2672B16A4DE; Mon, 31 Jul 2006 13:21:08 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh1.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id A053A43D46; Mon, 31 Jul 2006 13:21:07 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by mh1.centtech.com (8.13.1/8.13.1) with ESMTP id k6VDL63x080925; Mon, 31 Jul 2006 08:21:06 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44CE03D2.2050803@centtech.com> Date: Mon, 31 Jul 2006 08:21:22 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.4 (X11/20060612) MIME-Version: 1.0 To: Doug Barton References: <200607271150.k6RBoM9p031745@lurza.secnetix.de> <44C8FB65.9020102@FreeBSD.org> In-Reply-To: <44C8FB65.9020102@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1627/Sun Jul 30 18:34:54 2006 on mh1.centtech.com X-Virus-Status: Clean Cc: freebsd-hackers@freebsd.org Subject: Re: [PATCH] adding two new options to 'cp' X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jul 2006 13:21:08 -0000 On 07/27/06 12:44, Doug Barton wrote: > Oliver Fromme wrote: >> Eric Anderson wrote: >> > I'm tired of trying to use rsync or gcp (which doesn't like symlinks >> > often) to copy trees of files/directories using hard links, so I added >> > the gcp-ish options -a and -l. >> > >> > -a is 'archive' mode, which is just a quick form of -PpR. >> >> -P is the default anyway, so -a would only replace -Rp. >> I don't think saving one letter justifies introducing a new >> option. You can use an alias or shell function. >> >> > -l is 'link' mode, where regular files get hard linked instead of copied. >> > >> > So, you can mimic an entire tree with something like: >> > >> > cp -al /from/ /to/ >> > >> > and it's fast too! >> >> You can do the same with existing tools in a portable >> (and thus preferable) way: >> >> cd /from; find -d . | cpio -dumpl /to > > While I don't want to stifle anyone's creativity, I agree with Oliver (and > other posters) on this one. The Unix way of doing things is small programs > that do their jobs well, tied together to accomplish bigger things. > > Doug > Honestly, I agree with the 'Unix way', however if we really took that to heart, there would be no 'cp' at all. We'd use dd instead, along with find, and chmod/chown. But we don't - why? Same reason for adding nearly any option. All the mentions of cpio, pax, tar, etc, are all great, and I know of them, but they are harder to remember, more typing, less 'compatible' in some cases (not all), possibly more prone to human error (typos), etc. The patch doesn't change any current behavior, nor should it be noticed by anyone not looking for it. However, it is useful, and it does make our cp work just like the GNU cp, which eases the migration path for linux->FreeBSD users. I suppose I'm just missing the reason *not* to commit such a simple and useful set of options. Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------