[PATCH] adding two new options to 'cp'
Rick C. Petty
rick-freebsd at kiwi-computer.com
Tue Aug 1 18:43:56 UTC 2006
On Tue, Aug 01, 2006 at 02:26:28PM -0400, Mike Meyer wrote:
> In <20060801171150.GB3413 at megan.kiwi-computer.com>, Rick C. Petty <rick-freebsd at kiwi-computer.com> typed:
>
> > Obviously, I didn't add the error checking/handling, but AFAIK this is
> > essentially what the -S option to gnu's tar does.
>
> Yes, but gnu tar doesn't do this accurately,
That may be. I haven't looked at their code, I just assumed how they did
it.
> so you're not doing what
> Peter said you couldn't do. You are doing what Ivan asked, though.
That depends upon what you mean by "accurately" and what you mean by
"sparse". :-P Yes, if you're looking for a block-wise "dump" of a file
system's file, you use dump. If you're looking to make a "copy" of a file,
optimizing for sparseness, you use rsync. A pretty heavyweight solution
when you're trying to copy one file.
> I always think of cp as a tool for making *copies of files*, not for
> creating an archive of a directory tree. We've got lots of tools that
> do the latter. Do we really need another one?
I wasn't thinking of the "sparse handling" utility for whole trees, but it
would be useful for that also. I'm just looking for a lightweight tool
for copying files containing sparse chunks.. Since we switched to bsdtar,
the base system has been lacking this feature. To me, this seems more
useful (as a base feature) than hard-linking trees. But both have utility.
-- Rick C. Petty
More information about the freebsd-hackers
mailing list