holes in files

David Burren david at bacchus.esa.oz.au
Thu Jan 31 19:42:27 AEST 1991


In article <1111 at bacchus.esa.oz.au>, david at bacchus.esa.oz.au (David Burren) writes:
> Where can I find mention of the implementation of "holes" in files under
> the BSD ffs or other filesystems?
> Do I guess and assume that the relevant block pointer(s) have some
> sentinel value (eg. 0) to flag the fact that there is no data?

Thank you all who have responded.  Apparently that is how it's done.
One respondent noted that block 0 on the disks he'd looked at were
zeroed out and that that's why reading a hole returned zeros, but those
must have been non-boot disks that for some reason had block 0 cleared.
I was under the impression that it wasn't used on non-boot volumes.

Anyway, I'm told that the fs code interprets the 0 pointer as being to an
unallocated block no matter what the values in block 0 are.

Thanks folks, I don't think I need any more email on the subject....


> BTW, under some OSes I've seen processes with sparse address maps produce
> core dumps with holes in them.  I once had a user ask me "how can I make my
> file a core file?"  He was a student trying to get around quotas....

Yes folks, that time it was a SunOS 4.x machine.  Is anyone aware of other
flavours of Unix/etc that regularly exhibit the same behaviour?

- David B.



More information about the Comp.unix.wizards mailing list