Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Jul 2006 16:31:09 -0500
From:      "Rick C. Petty" <rick-freebsd@kiwi-computer.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: [PATCH] adding two new options to 'cp'
Message-ID:  <20060731213109.GA85795@megan.kiwi-computer.com>
In-Reply-To: <ealr31$q1b$1@sea.gmane.org>
References:  <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> <44CE40EA.5080009@centtech.com> <20060731184454.GA84483@megan.kiwi-computer.com> <ealr31$q1b$1@sea.gmane.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jul 31, 2006 at 11:01:24PM +0200, Ivan Voras wrote:
> Rick C. Petty wrote:
> 
> >"-l" may be a useful option, but at what point is the line drawn between
> >bloating our base cp and having a gcp port (or using linux_base)??
> 
> It's like saying "if you need this option, go to Linux" - it just seems 
> wrong.

Not quite.  I'm just saying that the "-l" option would be seldomly-used and
chances are that the people who would use it are likely to also have
linux_base installed.

> With all respect to "series of small utilities" way of doing things, I 
> think the "whatever is shorter to type" takes precedence :)

Ah, so then let's install a binary called "a" which is hard-linked to cp
and does the equivalent of "cp -a".  While we're at it, let's add a "t"
command as a shortcut to "tar -f".  [/sarcasm]

This is what aliases are for.  "cp -a" seems to me to be a silly way to
say "cp -pR".  Come on, it's only one letter shorter (although you could
argue the time it takes to hit the shift key counts as a letter).  I would
think that more BSD admins are so used to typing "cp -pR" than "cp -a".  In
any case, it seems pointless to waste a letter when an alias is a more
appropriate solution.  cp(1) uses getopt(3), so there are only so many
letters available.  It seems more useful to add other bits of functionality
and use up letters.  If you really want "-a" then it should copy sparse
files correctly, preserve hard links within the copied hierarchy (much like
rsync's -H option), and handle extended attributes (e.g. ACLs).  If not,
then save "-a" for something like ACLs.  Does cp(1) properly handle ACLs
now anyway?

> And it's not like the added code will have to be changed/maintained in 
> the forseeable future - if the basic implementation is ok, the 
> underlying structures and ideas will not change while UFS semantics are 
> in use.

Actually I have no gripe against "-l";  I was just making a point.  I think
this hard-link idea is pretty useful.

-- Rick C. Petty



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060731213109.GA85795>