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,c5a264f8d59bc01b X-Google-Attributes: gid103376,public From: David Brown Subject: Re: Streams - copying stdin to stdout Date: 1999/02/10 Message-ID: #1/1 X-Deja-AN: 442724642 Sender: davidb@dt022n82.san.rr.com References: <79jgaj$cjn$1@reader1.reader.news.ozemail.net> X-Trace: news.san.rr.com 918634852 204.210.11.130 (Wed, 10 Feb 1999 00:20:52 PDT) Organization: An individual on behalf of self. NNTP-Posting-Date: Wed, 10 Feb 1999 00:20:52 PDT Newsgroups: comp.lang.ada Date: 1999-02-10T00:00:00+00:00 List-Id: Stephen Leake writes: > "Chris Miller" writes: > > > To test the operation of Streams I wrote the following sample > > program that copies standard input to standard output : > > > > > while not Text_IO.End_Of_File loop > > > > The problem is that the input file has 5 bytes, which are the characters > > "test" plus the line feed added by vi, however the output file is only > > 4 bytes. > > I suspect you want Streams_IO.End_Of_File. Text_IO adds semantics > about line and page endings, which will get in your way. Streams_IO.End_Of_File wants a Ada.Stremas.Stream_IO.File_Type whereas we have either a Ada.Text_IO.Text_Streams.Stream_Access or Ada.Text_IO.File_Type (or File_Access). The RM doesn't say much about this. It looks to me like Text_IO's End_Of_File would be the one to use, but it doesn't work. David Brown dlbrown@acm.org