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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b5cd7bf26d091c6f X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: "John B. Matthews" Newsgroups: comp.lang.ada Subject: Re: Reading the while standard input into a String Date: Mon, 06 Jun 2011 14:14:39 -0400 Organization: The Wasteland Message-ID: References: NNTP-Posting-Host: LQJtZWzu+iKlBROuDg+IUg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news1.google.com comp.lang.ada:19645 Date: 2011-06-06T14:14:39-04:00 List-Id: In article , Natasha Kerensikova wrote: > I have encountered what was a very easily solved problem in C: dump > the whole contents of the standard input into some place in memory, > in order to process it afterwards. > > I was quite unhappy with the preprocessing performed by Ada.Text_IO, > so I went on using the text stream interface. However I still read > character by character into a temporary buffer, and it feels ugly. I usually just loop on Character'Read, as shown here: But I keep a link to this article around for reference: Gem #39: Efficient Stream I/O for Array Types [...] -- John B. Matthews trashgod at gmail dot com