comp.lang.ada
 help / color / mirror / Atom feed
* Use of streams with Ada95
@ 2001-05-25 21:53 Mike
  2001-05-25 21:59 ` Ted Dennison
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Mike @ 2001-05-25 21:53 UTC (permalink / raw)


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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Use of streams with Ada95
  2001-05-25 21:53 Use of streams with Ada95 Mike
@ 2001-05-25 21:59 ` Ted Dennison
  2001-05-25 22:15   ` Mike
  2001-05-25 22:00 ` James Rogers
  2001-05-29 14:28 ` Marin David Condic
  2 siblings, 1 reply; 9+ messages in thread
From: Ted Dennison @ 2001-05-25 21:59 UTC (permalink / raw)


In article <3b0ed42f$1@news.zen.co.uk>, Mike says...
>
>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
          home email - mailto:dennison@telepath.com



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Use of streams with Ada95
  2001-05-25 21:53 Use of streams with Ada95 Mike
  2001-05-25 21:59 ` Ted Dennison
@ 2001-05-25 22:00 ` James Rogers
  2001-05-25 22:27   ` Mike
  2001-05-29 14:28 ` Marin David Condic
  2 siblings, 1 reply; 9+ messages in thread
From: James Rogers @ 2001-05-25 22:00 UTC (permalink / raw)


Mike wrote:
> 
> 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



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Use of streams with Ada95
  2001-05-25 21:59 ` Ted Dennison
@ 2001-05-25 22:15   ` Mike
  0 siblings, 0 replies; 9+ messages in thread
From: Mike @ 2001-05-25 22:15 UTC (permalink / raw)


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


"Ted Dennison" <dennison@telepath.com> wrote in message
news:KAAP6.362$rn5.19136@www.newsranger.com...
> In article <3b0ed42f$1@news.zen.co.uk>, Mike says...
> >
> >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
>           home email - mailto:dennison@telepath.com





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Use of streams with Ada95
  2001-05-25 22:00 ` James Rogers
@ 2001-05-25 22:27   ` Mike
  2001-05-25 23:46     ` chris.danx
  0 siblings, 1 reply; 9+ messages in thread
From: Mike @ 2001-05-25 22:27 UTC (permalink / raw)


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

"James Rogers" <jimmaureenrogers@worldnet.att.net> wrote in message
news:3B0ED68A.8D9600B9@worldnet.att.net...
> Mike wrote:
> >
> > 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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Use of streams with Ada95
  2001-05-25 22:27   ` Mike
@ 2001-05-25 23:46     ` chris.danx
  2001-05-26  0:43       ` Mike
  0 siblings, 1 reply; 9+ messages in thread
From: chris.danx @ 2001-05-25 23:46 UTC (permalink / raw)



> 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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Use of streams with Ada95
  2001-05-25 23:46     ` chris.danx
@ 2001-05-26  0:43       ` Mike
  2001-05-26 16:43         ` chris.danx
  0 siblings, 1 reply; 9+ messages in thread
From: Mike @ 2001-05-26  0:43 UTC (permalink / raw)


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


"chris.danx" <chris.danx@ntlworld.com> wrote in message
news:p8CP6.2385$CT1.429185@news6-win.server.ntlworld.com...
>
> > 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.
>
>





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Use of streams with Ada95
  2001-05-26  0:43       ` Mike
@ 2001-05-26 16:43         ` chris.danx
  0 siblings, 0 replies; 9+ messages in thread
From: chris.danx @ 2001-05-26 16:43 UTC (permalink / raw)



"Mike" <mikecorney@zen.co.uk> wrote in message news:3b0efc12@news.zen.co.uk...
> 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.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Use of streams with Ada95
  2001-05-25 21:53 Use of streams with Ada95 Mike
  2001-05-25 21:59 ` Ted Dennison
  2001-05-25 22:00 ` James Rogers
@ 2001-05-29 14:28 ` Marin David Condic
  2 siblings, 0 replies; 9+ messages in thread
From: Marin David Condic @ 2001-05-29 14:28 UTC (permalink / raw)


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
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"Mike" <mikecorney@zen.co.uk> wrote in message
news:3b0ed42f$1@news.zen.co.uk...
> 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
>
>





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-05-29 14:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-25 21:53 Use of streams with Ada95 Mike
2001-05-25 21:59 ` Ted Dennison
2001-05-25 22:15   ` Mike
2001-05-25 22:00 ` James Rogers
2001-05-25 22:27   ` Mike
2001-05-25 23:46     ` chris.danx
2001-05-26  0:43       ` Mike
2001-05-26 16:43         ` chris.danx
2001-05-29 14:28 ` Marin David Condic

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