sparse files

John R. Levine johnl at esegue.segue.boston.ma.us
Thu Dec 14 04:24:44 AEST 1989


In article <2700 at auspex.auspex.com> guy at auspex.auspex.com (Guy Harris) writes:
>At least the first version of AIX for the RT PC claimed in its documentation
>that it had an "fclear()" call to punch holes in files; ...

Yes, it did, I put it there myself.  The semantics were basically the same
as a write of a buffer of zeros but the implementation promised to make holes
where it could.  In retrospect, it was a mistake.  One of my coworkers
proposed that we make write() a little smarter and have it notice when the
buffer was all-zero and write a hole.  At the time I thought that would be
too slow, but he correctly pointed out that few buffers that are not entirely
zero start with a lot of zeros, so in most cases the overhead would be tiny.
Fixing write() would have the enormous advantage of automatically making
cp, cpio, tar, dump/restor, and everything else do the right thing with
sparse files.
-- 
John R. Levine, Segue Software, POB 349, Cambridge MA 02238, +1 617 864 9650
johnl at esegue.segue.boston.ma.us, {ima|lotus|spdcc}!esegue!johnl
"Now, we are all jelly doughnuts."



More information about the Comp.unix.questions mailing list