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,FREEMAIL_FROM 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!news2.google.com!news.maxwell.syr.edu!newspeer.radix.net!uunet!ash.uu.net!spool.news.uu.net!not-for-mail Date: Mon, 30 Aug 2004 13:16:57 -0400 From: Hyman Rosen User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Binding to feof References: <6cAYc.2378$w%6.414@newsread1.news.pas.earthlink.net> In-Reply-To: <6cAYc.2378$w%6.414@newsread1.news.pas.earthlink.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1093886217.765346@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1093886217 11967 204.253.250.10 Xref: g2news1.google.com comp.lang.ada:3170 Date: 2004-08-30T13:16:57-04:00 List-Id: Jeffrey Carter wrote: > That would explain it. That seems to make the function useless, since > the other operations in my binding raise an exception if an operation > fails by reaching the end of file. You cannot have anticipatory feof from the keyboard without actually trying to read data and perhaps blocking, and in C, keyboard and file I/O use the same mechanism. So instead, feof was designed to be after the fact, so that when a read fails, you can check whether it was due to EOF or some other reason.