comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: How to hide instantiation of Direct_IO?
Date: 1997/03/02
Date: 1997-03-02T00:00:00+00:00	[thread overview]
Message-ID: <dewar.857305132@merv> (raw)
In-Reply-To: 5fb14p$qfb@mulga.cs.mu.OZ.AU


iFergus said
(answering me)

<<>Somehow, methinks that someone writing fsck in Ada might possibly NOT
>decide to use Direct_IO as the implementation vehicle :-)

Why not?>>

Well my smiley was there because I did not think anyone could possibly
conceive of the idea of using Direct_IO as an implementation vehicle for
fsck.

But since I was apparently mistaken ... :-)

Direct_IO is NOT a low level interface, it is a high level abstract
interface that tells you NOTHING about how records in the file are
mapped into the underlying file structures. Yes, it MIGHT be the case
that the mapping is a simple vector (rather than, for example a hash
table), but then again, it might be perfectly reasonable to use some
kind of indexing method that represented only records that are actually
present, and that would particularly be reasonable if you are representing
variable length items. Yes, it MIGHT be the case that there are no control
bytes (what in the Fortran world used to be called green words) with each
record, but then again it is perfectly reasonable to follow a typical
COBOL style of at least having a record present indicator for each record
(indeed on some systems, it may make excellent sense to map Direct_IO
into exactly the same file structure that COBOL uses for direct files).

Any attempt to use Direct_IO for low level mucking like fsck is therefore
fundamentally flawed and highly non-portable. In practice Stream_IO using
arrays of storage elements directly is the proper level of abstraction.





      reply	other threads:[~1997-03-02  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-11  0:00 How to hide instantiation of Direct_IO? Dale Stanbrough
1997-02-20  0:00 ` Norman H. Cohen
1997-02-22  0:00   ` Robert Dewar
1997-02-25  0:00     ` Norman H. Cohen
1997-02-25  0:00       ` Robert Dewar
1997-02-27  0:00         ` Norman H. Cohen
1997-03-01  0:00           ` Richard Kenner
1997-03-01  0:00             ` Robert Dewar
1997-03-02  0:00               ` Fergus Henderson
1997-03-02  0:00                 ` Robert Dewar [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox