comp.lang.ada
 help / color / mirror / Atom feed
From: Dale Stanbrough <dale@goanna.cs.rmit.edu.au>
Subject: Re: Portable way to read/write from a binary file?
Date: 20 Sep 1994 22:51:52 GMT
Date: 1994-09-20T22:51:52+00:00	[thread overview]
Message-ID: <35np28$4i2@goanna.cs.rmit.oz.au> (raw)
In-Reply-To: 35iuqj$5dj@goanna.cs.rmit.oz.au

I wrote:
>In article <Cw717J.66q@alsys.com> , kst@alsys.com writes:
>>For Ada 94 (assuming X=4 8-)}), I think Stream_IO does what you want.
>>
>
>Unfortunately not (as I read it!)
>Each object in a stream has a tag appended to it so that the 
>procedure S'Class'Read can reconstruct the value from the tag 
>contained within the stream (13.13.2.14).

Keith Thompson emailed a correction to this; what I said is true only
for tagged types.
I had previously skimmed over streams in the LRM and produced a particularly 
premature perception of how it performs. When Keith posted his original reply
I opened up the LRM to the section I quoted - the only bit which did agree with
how I thought it worked! (Damn!   !:-(   ).

So here's a question that I couldn't find the answer to (no more posturing
about how it does work from me! :-). Does a stream of heterogenous scalar
elements have any encoding so that you can decide what the byte stream
represents, or does the format of the data in a stream have to be previously
determined?

Dale
-------------------------------------------------------------
Dale Stanbrough, RMIT, Melbourne, Australia, dale@rmit.edu.au
GNU Ada 94 (GNAT) => the best $0 you'll ever spend.
Available for DOS, Linux, OS/2, Sun Sparc, Sun Solaris, ...
Coming to a GNU supported platform near you soon...



  parent reply	other threads:[~1994-09-20 22:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-09-14  1:40 Portable way to read/write from a binary file? Dale Stanbrough
1994-09-14  3:51 ` Robert Dewar
1994-09-16  1:47   ` Lee_Robert_Willis
1994-09-14 22:39 ` Dale Stanbrough
1994-09-15 17:08   ` Robert Dewar
1994-09-16  5:00   ` R_Tim_Coslet
1994-09-19  2:59     ` Dale Stanbrough
1994-09-19 17:46       ` Bob Duff
1994-09-20 22:51       ` Dale Stanbrough [this message]
1994-09-15 22:59 ` Keith Thompson @pulsar
replies disabled

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