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,start X-Google-Attributes: gid103376,public From: davidf@worf.mks.com (David J. Fiander) Subject: Reading sequential data from Ada.Text_Io.Standard_Input? Date: 1996/07/09 Message-ID: <4rsibv$2mo@ia.mks.com>#1/1 X-Deja-AN: 167311762 organization: Mortice Kern Systems Inc., Waterloo, Ontario, CANADA newsgroups: comp.lang.ada Date: 1996-07-09T00:00:00+00:00 List-Id: So, I want to read from standard input, using Ada.Sequential_Io. I've got declare type Byte is mod 256; for Byte'Size use 8; package Byte_Io is new package Ada.Sequential_Io(Byte); Ch: Byte; begin Byte_Io.Read(Text_Io.Standard_Input, Ch); -- process the byte; end; which clearly doesn't work, since Text_Io.Standard_Input is most definitely not a Byte_Io.File_Type. So I try Byte_Io.Read(Byte_Io.File_Type(Text_Io.Standard_Input), Ch); at which Gnat reports "ambiguous operand", since Standard_Input is either a Text_Io.File_Type or a Text_Io.File_Access and Gnat can't figure out which I want. So I try Byte_Io.Read(Byte_Io.File_Type(Text_Io.File_Type'(Text_Io.Standard_Input)), Ch); which is certainly a mouthful, but also doesn't work. Gnat reports invalid conversion, not compatible with private type "Ada.Text_Io.File_Type" thereby informing me that, now that it knows what I want to do, it's decided that I can't get there from here. So, what, if anything, is the magic incantation to read raw data from standard input? - David