Re: [linux-audio-dev] using ext2fs "holes" in files

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] using ext2fs "holes" in files
From: Benno Senoner (sbenno_AT_gardena.net)
Date: ti loka   19 1999 - 17:50:56 EDT


On Mon, 18 Oct 1999, Paul Barton-Davis wrote:

[ ... filesystem holes discussion ... ]

> furthermore, i don't rely in any way on whether or not "holes" are
> supported. all i do is to lseek to the right offset in a file and
> write there: i don't care whether the fs zero fills real disk blocks,
> uses holes or whatever. All I care about is that POSIX says that
> whenever i read back the file, I will read zeros in from any offsets
> that I skipped without having previously written them.
>
> it just so happens that ext2fs (and some of its predecessor file
> systems) were designed to allow files with "holes" as an efficient use
> of disk space, but thats just an implementation detail that adds an
> additional, but not central argument in favor of doing this.
>

Agreed,
the POSIX semantics say that we can seek beyond the EOF, therefore
why should we not use this nice feature ?

I remember several years ago, when I was at the college, and we played with
286 boxes running DOS and GWBasic,
our CS professor gave us a problem to solve (on paper only , basic code was
required) which involved such a "holes" problem.

Of course, since I knew that DOS provides these seek semantics ,
I implemented the algorithm in a smart way, and I risked a bad mark for this
exam.
The teacher said my code is totally wrong and I have to write zeroes
to the file.
He didn't believe me until I showed him the truth, by running my code on a
real box. He was very perplexed about the fact
*HEHE*
:-)

Benno.


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:27:59 EST