Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!lotus!esegue!johnl From: johnl@esegue.segue.boston.ma.us (John R. Levine) Newsgroups: comp.unix.questions Subject: Re: sparse files Message-ID: <1989Dec13.172444.27531@esegue.segue.boston.ma.us> Date: 13 Dec 89 17:24:44 GMT References: <21581@adm.BRL.MIL> <235@dg.dg.com> <2700@auspex.auspex.com> Reply-To: johnl@esegue.segue.boston.ma.us (John R. Levine) Organization: Segue Software, Cambridge MA Lines: 18 In article <2700@auspex.auspex.com> guy@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@esegue.segue.boston.ma.us, {ima|lotus|spdcc}!esegue!johnl "Now, we are all jelly doughnuts."