[comp.sys.amiga] Sparse files.

mwm@eris.BERKELEY.EDU (Mike (My watch has windows) Meyer) (05/25/87)

In article <8705232024.AA15280@cogsci.berkeley.edu> bryce@COGSCI.BERKELEY.EDU (Bryce Nesbitt) writes:
<1> Can anything other than a sector editor produce a sparse file?

Doesn't looke like it. The last sentence for the Seek() entry in the
AmigaDOS Developer's Manual says:

	You cannot Seek beyond the end of a file.

Trying to do so verifies this (Me, believe manuals? Hah! I've been
hacking Unix long enough to know better than that!). Suddenly I feel
like I'm stranded on a VMS system....

<2> Is there *any* use for a sparse file at the filesystem level?
<   Name *one* use that could not be better served in another manner,

Almost any sparse data structure stored on disk likes spares files.
Take a look at the dbm code, for instance. It hashes the key to
produce a block address to store data at. Or personal example: I
needed to store short (~120 bytes) records on a three-character key.
So you cram the bytes together, multiply by record size, and do a seek
(roughly, anyway). The alternative data structure we considered was a
trie, which also wanted a sparse data file.

[Thinking about it, an Amiga would have been damn near _perfect_ for
that project, barring the lack of sparse files. But working around
that would have been easier than the workarounds the amiga would have
prevented. To bad it didn't exist then.]

As a more esoteric example, if your OS supports sparse address spaces
in a process, then saving/restarting some interpreted language systems
gets easier.

If you can demonstrate better (by some measure other than "doesn't use
sparse files") ways to do the sparse data applications, I'd like to
hear about them.

<   I'm curious!

Ah, but what color are you when you're curious? Or is this just a case
of "enquiring minds want to know"?

	<mike
--
How many times do you have to fall			Mike Meyer
While people stand there gawking?			mwm@berkeley.edu
How many times do you have to fall			ucbvax!mwm
Before you end up walking?				mwm@ucbjade.BITNET