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!news1.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Reading the while standard input into a String Date: Mon, 06 Jun 2011 18:14:57 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1307398498 14964 192.74.137.71 (6 Jun 2011 22:14:58 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Mon, 6 Jun 2011 22:14:58 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:dtMd1ezXYu1lxy7hUFQy49gQLqo= Xref: g2news1.google.com comp.lang.ada:19654 Date: 2011-06-06T18:14:57-04:00 List-Id: Ludovic Brenta writes: > Personally I think this is a fundamentally bad idea. Consider: > > $ my_program < /dev/random What do you expect sort /dev/random to do? Or tail /dev/random ? ;-) ;-) > Note that reading one character at a time from a stream is quite fast > since streams normally use the operating system's buffered IO. Adding > a second layer of buffering inside your program is probably counter- > productive. Yes, probably. - Bob