Re: [PATCH] adding two new options to 'cp'



Oliver Fromme wrote:
Eric Anderson <anderson@xxxxxxxxxxxx> 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

--

This .signature sanitized for your protection

_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: [PATCH] adding two new options to cp
    ... often) to copy trees of files/directories using hard links, ... added the gcp-ish options -a and -l. ...
    (freebsd-hackers)
  • Re: [PATCH] adding two new options to cp
    ... often) to copy trees of files/directories using hard links, ... the gcp-ish options -a and -l. ... Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing ...
    (freebsd-hackers)
  • Re: [PATCH] adding two new options to cp
    ... often) to copy trees of files/directories using hard links, so I added the gcp-ish options -a and -l. ... Patch is against 6-STABLE, but works well on 7-CURRENT as well. ... Committers willing to commit? ...
    (freebsd-hackers)