Use of streams with Ada95 
Author Message
 Use of streams with Ada95

Any one got an example of using streams for offline storage, i.e. to provide
interface to write and read back from storage. Booch and Barnes don't seem
to describe this in much detail

Thanks

Mike



Wed, 12 Nov 2003 05:53:04 GMT  
 Use of streams with Ada95

Quote:

>Any one got an example of using streams for offline storage, i.e. to provide
>interface to write and read back from storage. Booch and Barnes don't seem
>to describe this in much detail

What precisely do you mean by "offline"?

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html



Wed, 12 Nov 2003 05:59:06 GMT  
 Use of streams with Ada95

Quote:

> Any one got an example of using streams for offline storage, i.e. to provide
> interface to write and read back from storage. Booch and Barnes don't seem
> to describe this in much detail

Cohen (Ada as a Second Language, Second edition) describes this in
adequate detail including examples. His section on streams starts on
page 786 and continues through page 794.

Jim Rogers
Colorado Springs, Colorado USA



Wed, 12 Nov 2003 06:00:27 GMT  
 Use of streams with Ada95
Sorry, Friday night, a bit vague!
Looking to store data onto permanent storage (disk) and would
need to read data back off it as well.
Not quite sure how its going to work yet, but am looking to
provide an interface to write any type into a stream and write
that stream data (sequence of unsigned integers) onto the disk
and to then later recover it into the original type.

Thanks


Quote:

> >Any one got an example of using streams for offline storage, i.e. to
provide
> >interface to write and read back from storage. Booch and Barnes don't
seem
> >to describe this in much detail

> What precisely do you mean by "offline"?

> ---
> T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html




Wed, 12 Nov 2003 06:15:20 GMT  
 Use of streams with Ada95
Thanks for that, looking for the second edition on
amazon - out of stock at the moment. Looks like a
good book. Will try and track it down.

Mike


Quote:

> > Any one got an example of using streams for offline storage, i.e. to
provide
> > interface to write and read back from storage. Booch and Barnes don't
seem
> > to describe this in much detail

> Cohen (Ada as a Second Language, Second edition) describes this in
> adequate detail including examples. His section on streams starts on
> page 786 and continues through page 794.

> Jim Rogers
> Colorado Springs, Colorado USA



Wed, 12 Nov 2003 06:27:54 GMT  
 Use of streams with Ada95

Quote:
> Thanks for that, looking for the second edition on
> amazon - out of stock at the moment. Looks like a
> good book. Will try and track it down.

In the mean time you could try http://willowplan.tripod.com under Ada
95->Examples->Streams.  It's a small example for using streams with files if
that's any use (it's not at great depth but it covers heterogenous files).  One
flaw is that when i wrote it i didn't convert to stream elements i just wrote a
small replacement for read/write based on the types in the records versions.

Chris.



Wed, 12 Nov 2003 07:46:13 GMT  
 Use of streams with Ada95
Thanks, some useful info, can't seem to access the zip file
with the example though. I'll send an email.


Quote:

> > Thanks for that, looking for the second edition on
> > amazon - out of stock at the moment. Looks like a
> > good book. Will try and track it down.

> In the mean time you could try http://willowplan.tripod.com under Ada
> 95->Examples->Streams.  It's a small example for using streams with files
if
> that's any use (it's not at great depth but it covers heterogenous files).
One
> flaw is that when i wrote it i didn't convert to stream elements i just
wrote a
> small replacement for read/write based on the types in the records
versions.

> Chris.



Wed, 12 Nov 2003 08:43:15 GMT  
 Use of streams with Ada95

Quote:

> Thanks, some useful info, can't seem to access the zip file
> with the example though. I'll send an email.

Got the email! It's fixed now.


Thu, 13 Nov 2003 00:43:28 GMT  
 Use of streams with Ada95
Look at my web page (http://www.mcondic.com/) on the Ada Programming page
for a collection of code named "gnat_examples.chop" Search it for "Streams".
There are a couple of programs in there that do I/O to files using streams.
Note that to utilize streams with structured data (records, etc), you have a
kind of two stage process. First you have to use the 'Read and 'Write (or
'Input & 'Output) to get the structured data into the stream, then use the
Stream_IO facilities to get the data out or in to the file.

I may have a more detailed example around here somewhere of actually making
that happen if you need it, but I'd have to dig. If you know how to get the
data into and out of the stream, the I/O should be pretty straightforward.

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution

Web:      http://www.mcondic.com/


Quote:
> Any one got an example of using streams for offline storage, i.e. to
provide
> interface to write and read back from storage. Booch and Barnes don't seem
> to describe this in much detail

> Thanks

> Mike



Sat, 15 Nov 2003 22:28:47 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. GNAT/Ada95 Streams Performance Issue

2. Streams Quandry in Ada95

3. Ada95 Streams

4. Ada95 Streams Question

5. Ada95 Compiler Performance / Ada95 X bindings?

6. differences between ada95 using O32 and N32 on SGI's

7. Ada95 compiler using Ada83 as back-end

8. Using C dll from Ada95

9. Parallel programing in Linux Cluster using Ada95

10. Using C++ ifstream class in Ada95

11. Optimising Browse Load with Buffering using STREAM and FLUSH

12. Using STREAM

 

 
Powered by phpBB® Forum Software