[PATCH] adding two new options to 'cp'

Peter Jeremy peterjeremy at optushome.com.au
Wed Aug 2 07:33:47 UTC 2006


On Tue, 2006-Aug-01 23:35:03 -0700, Tim Kientzle wrote:
>The "cheap" solution is to handle it purely on
>extract:  Detect blocks of zeros when restoring
>files and seek over them.

The downside is that you wind up with a sparse file whether or not you
wanted one.

>  I simply dislike
>the GNU tar approach, in part because it requires
>two passes over the file (the map of holes is required
>before the file is written).

Actually, the only real solution to copying sparse files is to add
a system call that can return a map of holes.  This would neatly
address the "needs two passes" problem with tar.

As a general comment (not addressed to Tim):  There _is_ a downside
to sparsifying files.  If you take a sparse file and start filling
in the holes, the net result will be very badly fragmented and hence
have very poor sequential I/O performance.  If you're never going to
update a file then making it sparse makes sense, if you will be
updating it, you will get better performance by making it non-sparse.

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20060802/2d759a75/attachment.pgp


More information about the freebsd-hackers mailing list