From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f6f130eea077b8f8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-23 13:48:51 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!cyclone.bc.net!tdsnet-transit!newspeer.tds.net!news.binc.net!kilgallen From: Kilgallen@SpamCop.net (Larry Kilgallen) Newsgroups: comp.lang.ada Subject: AI-248 and counting the elements in an external file Date: 23 May 2003 15:48:17 -0500 Organization: LJK Software Message-ID: References: NNTP-Posting-Host: eisner.encompasserve.org X-Trace: grandcanyon.binc.net 1053722840 6494 192.135.80.34 (23 May 2003 20:47:20 GMT) X-Complaints-To: abuse@binc.net NNTP-Posting-Date: Fri, 23 May 2003 20:47:20 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:37716 Date: 2003-05-23T15:48:17-05:00 List-Id: I suppose my lack of experience with Ada95 streams ('read, etc.) may be the reason for my confusion, but in reading http://www.ada-auth.org/cgi-bin/cvsweb.cgi/AIs/AI-00248.TXT?rev=1.16 I see in several places the text: The size of an external file is the number of stream elements contained in the file. That is straightforward for a file of some record type, or a file of integers, but what if the file is one created with Ada95 stream semantics ? I thought that 'write and write() relied upon the reading program to know "how" to read the file, and that implementations would not have kept a tally of how many elements were in the file. I don't know enough about this to know if it is possible to do a linear search of a file to count the elements, but even if it were, that would be a very slow operation. Is it envisioned by the authors of AI-248 that implementations would preserve metadata containing the element count ? If so, what about stream files that were written under Ada95 ? Or can someone suggest what it is that I don't understand about Ada streams ?