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,dcb81b5322bf4a6d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newshub.sdsu.edu!elnk-nf2-pas!elnk-pas-nf1!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread2.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 MSIE X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Binding to feof References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Sat, 28 Aug 2004 01:48:16 GMT NNTP-Posting-Host: 63.184.104.74 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.news.pas.earthlink.net 1093657696 63.184.104.74 (Fri, 27 Aug 2004 18:48:16 PDT) NNTP-Posting-Date: Fri, 27 Aug 2004 18:48:16 PDT Xref: g2news1.google.com comp.lang.ada:3107 Date: 2004-08-28T01:48:16+00:00 List-Id: Jerry van Dijk wrote: > > If the binding is correct, it should work. Could you show an example > of the code and how you use it ? function End_Of_File (File : File_Handle := Standard_Input) return Boolean is Result : Int; function C_EOF (File : File_Handle) return Int; pragma Import (C, C_EOF, "feof"); -- This seems to always return zero, even when at the EOF. begin -- End_Of_File Result := C_EOF (File); return Result /= 0; end End_Of_File; Including debug statements indicates that Result is always zero. > I am not sure why you would want to do this though. If you want to > use/interface to the C stream API, GNAT already provides a binding. > If you are looking for the most efficient code, you need to use the > Win32 file API, as the C API, on Windows, is itself also a binding to > the Win32 API. None of the above. I don't want to use C streams, nor am I interested in the most efficient code. I just want to experiment with text I/O that doesn't count columns, lines, and pages, to see how it compares. -- Jeff Carter "Have you gone berserk? Can't you see that that man is a ni?" Blazing Saddles 38