comp.lang.ada
 help / color / mirror / Atom feed
From: michael@ifr.luftfahrt.uni-stuttgart.de (Michael Paus)
Subject: Re: Reading sequential data from Ada.Text_Io.Standard_Input?
Date: 1996/07/09
Date: 1996-07-09T00:00:00+00:00	[thread overview]
Message-ID: <4rtrqi$260i@info4.rus.uni-stuttgart.de> (raw)
In-Reply-To: 4rsibv$2mo@ia.mks.com


davidf@worf.mks.com (David J. Fiander) wrote:
> So, I want to read from standard input, using Ada.Sequential_Io.
> 
[...]
> So, what, if anything, is the magic incantation to read raw data
> from standard input?

The key to this kind of problem is to use the new Ada 95 streams
facility. Have a look at "A.12 Stream Input-Output". You can get
a stream access value which is associated with Standard_Input with
a declaration like this:

  S  : Ada.Text_IO.Text_Streams.Stream_Access
       := Ada.Text_IO.Text_Streams.Stream(Ada.Text_IO.Standard_Input);

You will need to with 
Ada.Text_IO, Ada.Text_IO.Text_Streams and Ada.Streams.Stream_IO
in order to get that working.

Have fun

Michael

PS: If you are interested I can send you a little example with a writer
application which writes a data structure to a stream which is
associated with standard output and a reader application which recreates
this data structure from a stream which is connected to standard input.
On UNIX you might then execute these apps like

> writer | reader

which means that the data produced by writer is piped into reader.

-- 
------------------------------------------------------------------------
--Dipl.-Ing. Michael Paus   (Member: Team Ada)
--University of Stuttgart, Inst. of Flight Mechanics and Flight Control
--Forststrasse 86, 70176 Stuttgart, Germany
--Phone: (+49) 711-121-1434  FAX: (+49) 711-634856
--Email: Michael.Paus@ifr.luftfahrt.uni-stuttgart.de (NeXT-Mail welcome)





  reply	other threads:[~1996-07-09  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-09  0:00 Reading sequential data from Ada.Text_Io.Standard_Input? David J. Fiander
1996-07-09  0:00 ` Michael Paus [this message]
1996-07-09  0:00 ` Robert Dewar
1996-07-09  0:00 ` Robert A Duff
replies disabled

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