[comp.text] Sparse files

emcmanus@cs.tcd.ie (Eamonn McManus) (11/12/88)

In article <17462@adm.BRL.MIL> Makey@logicon.arpa (Jeff Makey) writes:
>Few files on most UNIX systems need the sparse-file feature.  However,
>I once was messing with some custom database files that were very
>large and very sparse.  In order to copy one of these database files
>and not fill up the file system I had to write my own version of "cp"
>which scanned each input block and didn't write it out if it contained
>all zeroes.

Another useful application of a program like this is for systems like TeX,
where an executable file is created that has its initialisation code
already done.  This is (effectively) achieved by running the initialisation
code, producing a core-dump, and making a new executable from the result.
There is no bss segment in the resultant program so it tends to have huge
patches of zeros in the data segment, especially if it has been configured
with large arrays.  I was able to reduce the TeX executable to 47% of its
original size by using a program like yours.  (Do more recent TeX
distributions have this idea already?)