From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 31 17:42:00 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 E845B16A4DE for ; Mon, 31 Jul 2006 17:41:59 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh2.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id D47DB43D92 for ; Mon, 31 Jul 2006 17:41:47 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by mh2.centtech.com (8.13.1/8.13.1) with ESMTP id k6VHfk3J009828; Mon, 31 Jul 2006 12:41:46 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44CE40EA.5080009@centtech.com> Date: Mon, 31 Jul 2006 12:42:02 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.4 (X11/20060612) MIME-Version: 1.0 To: rick-freebsd@kiwi-computer.com References: <200607271150.k6RBoM9p031745@lurza.secnetix.de> <44C8FB65.9020102@FreeBSD.org> <44CE03D2.2050803@centtech.com> <17614.4005.407223.621637@bhuda.mired.org> <44CE199C.2020500@centtech.com> <17614.8289.134373.387558@bhuda.mired.org> <96b30c400607310847s1d2f845eo212b234d03f51e9a@mail.gmail.com> <20060731172858.GA84042@megan.kiwi-computer.com> In-Reply-To: <20060731172858.GA84042@megan.kiwi-computer.com> 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 mh2.centtech.com X-Virus-Status: Clean Cc: freebsd-hackers@freebsd.org, Juan Rodriguez 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 17:42:00 -0000 On 07/31/06 12:28, Rick C. Petty wrote: > On Mon, Jul 31, 2006 at 05:47:09PM +0200, Juan Rodriguez wrote: >> My GNU version of "cp" has more than 18 options, the FreeBSD >> version only has 9. >> >> As I usually work with Linux machines, I'm used to "cp -a" and I have always >> hated to have to look up in the FreeBSD's "cp" manual page for the right >> options to get the same funtionality. I tend to think >> that "-a" is option bloating because it's not really needed, but I see >> "-l" as a new feature for "cp" that might be useful. > > I agree, -a is bloat. However I don't understand why you say: > >> To sum it up, I think "cp -a" and "cp -l" are both useful, > > I agree that the "-l" option *may* be useful. > >> the first one >> because of compatibility with the large base of Linux systems out there, and >> the second one because I think it's a useful feature for the FreeBSD "cp". > > In both cases, why don't you just use: > > /usr/compat/linux/bin/cp Two reasons - it's not in the base system, so a port has to be installed - and linux_base is FC3 now, so if you want to talk about bloat... Another reason is gcp fails to recursively copy a directory that has symlinks in it. Example: $ cd /tmp/ $ mkdir test $ touch test/t $ ln -s t test/b $ ls -al test/ drwxr-xr-x 2 anderson wheel 512 Jul 7 09:39 . drwxrwxrwt 69 root wheel 8704 Jul 7 09:39 .. lrwxr-xr-x 1 anderson wheel 1 Jul 7 09:39 b -> t -rw-r--r-- 1 anderson wheel 0 Jul 7 09:39 t $ gcp -al test/ test2/ $ ls -al test2/ drwxr-xr-x 2 anderson wheel 512 Jul 7 09:39 . drwxrwxrwt 70 root wheel 8704 Jul 7 09:40 .. -rw-r--r-- 3 anderson wheel 0 Jul 7 09:39 b -rw-r--r-- 3 anderson wheel 0 Jul 7 09:39 t ( you can see it made a resolved the symlink and made a hardlink to the symlink destination, not exactly what I would want, but didn't fail) However, now do: $ ln -s /tmp/ test/link-to-dir $ ls -al test/ drwxr-xr-x 2 anderson wheel 512 Jul 7 09:43 . drwxrwxrwt 70 root wheel 8704 Jul 7 09:40 .. lrwxr-xr-x 1 anderson wheel 1 Jul 7 09:39 b -> t lrwxr-xr-x 1 anderson wheel 5 Jul 7 09:43 link-to-dir -> /tmp/ -rw-r--r-- 3 anderson wheel 0 Jul 7 09:39 t $ gcp -al test/ test2/ gcp: cannot create link `test2/test/link-to-dir': Operation not permitted gcp gets an error when copying symlinks that point to directories. Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------