Re: Do any java.io classes support inserting text into a file?
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
---910079544-737936521-1219407313=:16166
Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8BIT
On Thu, 21 Aug 2008, Eric Sosman wrote:
Tom Anderson wrote:
On Wed, 20 Aug 2008, Eric Sosman wrote:
Tom Anderson wrote:
On Tue, 19 Aug 2008, Arne Vajh?j wrote:
Tom Anderson wrote:
[...]
But you could imagine a filesystem which did make efficient inserts
possible. The trick would be to allow partially-filled blocks inside a
file, so that if you want to insert or prepend less than a block's
worth (or some non-integer multiple of a block's worth) of data, you
could partially fill a block, then splice it into the middle of the
file.
It could be done.
But I don't think anyone would.
Probably not!
You are wrong, with 100% probability. I was there.
What? Where were you? And who's wrong about what?
I was at Atex Inc. And you were wrong about "probably not."
Aha!
Atex' file system was heavily specialized and unlike anything else
I've run across. Files were doubly-linked lists of disk blocks, so it
was easy to remove or insert material at any position in a file,
including at the beginning. (That's what I meant with my analogy of
taping a fresh slip of paper to the top of the page.) Partially-filled
blocks were padded with zeroes, which readers automatically ignored.
Okay, so more or less what i was thinking. Cool!
Was there a particular application that motivated this design?
Anyhow, my original point was not about the details of how this
operation was supported on one file system, but about the rarity of file
systems that support it. The rarity, I suggested, was the reason Java
has no built-in support for such insertions.
Fair enough.
tom
--
Mpreg is short for Male Impregnation and I cannot get enough. -- D
---910079544-737936521-1219407313=:16166--