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,a3fe2aac201210c0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Fri, 16 Jul 2004 16:18:58 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <40f6bf21@dnews.tpgi.com.au> Subject: Re: reading a text file into a string Date: Fri, 16 Jul 2004 16:19:28 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-8hRgmIeIyhEuWWLPSAVC8GwkW1Wyz9bBk2sDiMf+c8xNgP4dNOGIfjL8/V0ssUzTo69T4wgGyjTF+uA!/2MrMPuQ9BgtvLiuJ7JrRoKEwLgzZ+xkzOab9WuuZkYdzQQBiR7YlQOnkjZydhWHTM9ZDyKgd/tx X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: g2news1.google.com comp.lang.ada:2202 Date: 2004-07-16T16:19:28-05:00 List-Id: "Steve" wrote in message news:E1HJc.101277$Oq2.96646@attbi_s52... > Sorry for the blank reply (obese finger) > > The easiest way to read an entire file into a string, if you're looking for > speed, is to > use Ada.Direct_Io; ... That's how you'd do that in Ada 83, but in Ada 95 you could do the same with Stream_IO, without needing the weird instantiations. (Yes, you'd be assuming that Stream_Element'Size = Character'Size, but since this technique really only works on Windows and Unix anyway [as noted by others], that's not an issue.) Randy.