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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a63bfa12efaa021 X-Google-Attributes: gid103376,public From: michael@ifr.luftfahrt.uni-stuttgart.de (Michael Paus) Subject: Re: Reading sequential data from Ada.Text_Io.Standard_Input? Date: 1996/07/09 Message-ID: <4rtrqi$260i@info4.rus.uni-stuttgart.de>#1/1 X-Deja-AN: 167391672 references: <4rsibv$2mo@ia.mks.com> organization: Comp.Center (RUS), U of Stuttgart, FRG newsgroups: comp.lang.ada Date: 1996-07-09T00:00:00+00:00 List-Id: 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)