[PATCH] adding two new options to 'cp'

Garance A Drosehn gad at FreeBSD.org
Tue Aug 1 17:07:05 UTC 2006


At 12:07 PM +0200 8/1/06, Ivan Voras wrote:
>Peter Jeremy wrote:
>
>>Note that it isn's possible to accurately distinguish
>>between a block of NULs and a hole in the file through
>>the filesystem.  The only way to accurately copy a
>>sparse file is with dump/restore.
>
>Hence the need for an explicit switch.

The point is not that you need an explicit switch, the
point is that you have to add a lot of code to 'cp' for
'cp' to do the job correctly.  You are changing the
nature of how the command works.  I very much doubt you
can implement that *correctly* in a mere 160 bytes of
additional object code!

Note:
-r-xr-xr-x  1 root  wheel  15348  [date]  /bin/cp
-r-xr-xr-x  2 root  wheel  44288  [date]  /sbin/dump
-r-xr-xr-x  2 root  wheel  58736  [date]  /sbin/restore

I realize a lot of these decisions are somewhat subjective.
"One person's feature is another person's bloat".  But in
the case of this specific example, I (personally) would
not want 'cp' to implement every detail which is already
handled by dump/restore.

-- 
Garance Alistair Drosehn     =               drosehn at rpi.edu
Senior Systems Programmer               or   gad at FreeBSD.org
Rensselaer Polytechnic Institute;             Troy, NY;  USA


More information about the freebsd-hackers mailing list