comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: AI-248 and counting the elements in an external file
Date: Wed, 28 May 2003 13:26:09 -0500
Date: 2003-05-28T13:26:09-05:00	[thread overview]
Message-ID: <vd9vnrma3ss723@corp.supernews.com> (raw)
In-Reply-To: $ghCR$mci5sd@eisner.encompasserve.org


Larry Kilgallen wrote in message
<$ghCR$mci5sd@eisner.encompasserve.org>...
>In article <vd7hvtd5dkqr17@corp.supernews.com>, "Randy Brukardt"
<randy@rrsoftware.com> writes:
>
>> The intent is that it be well-defined (which might include raising
>> Use_Error if if cannot be figured out, as for a keyboard) for files
that
>> can be read or written by Ada. If Ada doesn't understand the files at
>> all, then we're not trying to say anything.
>>
>> I would expect that this functionality would take more work on some
OSes
>> than it does on Windows or Unix. On the original CP/M, for instance,
you
>> had to figure out the file size by finding out the block size and
>> multiplying it by the number of blocks. That's fine, and keep in mind
>> that this result really is intended to report the physical size of
the
>> file,
>
>The idea of "physical size -- does not have to accurately represent
>size of data contained" was not at all clear to me reading AI-248.
>Is that stated in there, or are there plans for an AI- about AI-248 ?

Why would you expect otherwise? The 'size in Storage_Elements' for a
Direct_IO file certainly doesn't have to be the number of records
(Count) * the size of a record, even though it is often implemented that
way. There may be control information, or (like on the CP/M systems I
mentioned previously), there may be some rounding up. Certainly the
standard has nothing to say about this, and Ada.Directories is not
intended to change anything in this area. It was carefully written with
the intent of not adding any unintended requirements about file
representation, because that would be incompatible, and for no good
reason.

Anyway, AI-248 appears to require that Ada.Directories.Size =
Ada.Streams.Stream_IO.Size for a stream file, but that ought to not have
any implementation burden. But for any file type that is not a stream
file (that is, could not be Created by Stream_IO.Open) (or is a
non-positionable stream file), the meaning of Ada.Directories.Size is
essentially implementation defined, because the standard says nothing
about the representation of Sequential_IO, Text_IO, and Direct_IO files,
and thus the maping to stream elements is not defined by the standard.

You have to remember that the wording part of an AI is written to be
part of the standard. That means if it doesn't say something, that means
that the interpretation is being left to the implementor. It's not
practical to put every possible nuance into an AI; indeed, when I've
done that in the past, I've generally been asked to remove such
discussions as clutter. Too much clutter makes an AI hard to read and
digest.

If you have a specific suggestion for an improvement, I'd be happy to
hear it. (Even better, submit it to Ada-Comment to put it into the
official record.)

                   Randy Brukardt
                   ARG Editor







  reply	other threads:[~2003-05-28 18:26 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-21  0:07 'Write attribute vs Write procedure Jano
2003-05-21  0:42 ` tmoran
2003-05-21  7:48   ` Ole-Hjalmar Kristensen
2003-05-21  9:23   ` Ole-Hjalmar Kristensen
2003-05-21 16:22     ` tmoran
2003-05-22  7:51       ` Ole-Hjalmar Kristensen
2003-05-21 16:24     ` tmoran
2003-05-21 21:17     ` Simon Wright
2003-05-22  8:02       ` Ole-Hjalmar Kristensen
2003-05-22 13:49       ` Marc A. Criley
2003-05-22 20:07         ` Simon Wright
2003-05-23  6:09   ` Craig Carey
2003-05-23 19:55     ` Simon Wright
2003-05-23 20:48       ` AI-248 and counting the elements in an external file Larry Kilgallen
2003-05-23 21:12         ` Stephen Leake
2003-05-23 21:45           ` Randy Brukardt
2003-05-24  1:45             ` Larry Kilgallen
2003-05-24 22:00               ` Robert I. Eachus
2003-05-25  3:54                 ` Larry Kilgallen
2003-05-27 20:19                   ` Randy Brukardt
2003-05-27 20:57                     ` Larry Kilgallen
2003-05-28 18:26                       ` Randy Brukardt [this message]
2003-05-24  1:42           ` Larry Kilgallen
2003-05-28 21:17             ` Brian Gaffney
2003-05-28 22:06               ` Larry Kilgallen
2003-05-24 14:11 ` 'Write attribute vs Write procedure Craig Carey
replies disabled

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