From: "A. Sinan Unur" Newsgroups: comp.os.msdos.djgpp Subject: Re: feof(FILE *) NOT portable... Date: Thu, 11 May 2000 14:29:34 -0400 Organization: http://unur.com/ Lines: 41 Sender: verified_for_usenet AT cornell DOT edu (asu1 on 128.253.251.163) Message-ID: <8feu8a$p99$1@news01.cit.cornell.edu> References: <8empao$5k6$1 AT nnrp02 DOT primenet DOT com><390ef9f9$0$72098 AT SSP1NO17 DOT highway DOT telekom DOT at><8emvhq$7mn$1 AT nnrp03 DOT primenet DOT com><3 DOT 0 DOT 6 DOT 32 DOT 20000505015633 DOT 007b2210 AT pop DOT crosswinds DOT net> <3 DOT 0 DOT 6 DOT 32 DOT 20000510204858 DOT 007b6e40 AT pop DOT crosswinds DOT net> NNTP-Posting-Host: 128.253.251.163 X-Trace: news01.cit.cornell.edu 958069834 25897 128.253.251.163 (11 May 2000 18:30:34 GMT) X-Complaints-To: usenet AT news01 DOT cit DOT cornell DOT edu NNTP-Posting-Date: 11 May 2000 18:30:34 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com > Well, after a good several hours of debugging, I finally discovered > that feof(FILE *) does NOT work the same under DJGPP as it does > under other compilers. This makes me VERY bitter. oh no ... the world's going to end now. please take a look at Steve Summit's C FAQ available at http://www.eskimo.com/~scs/C-faq/q12.2.html. > While I really doubt that Borland could be wrong, the possibility > still exists. I have been using some very important file read > functions and it makes me upset that to detect the EOF with feof, > you have to read one character past the file. In a NORMAL > programming language (anything other than DJGPP) you can read the > last character, call feof(FILE *), and it will return that it has > indeed reached the end of file. it is not about whether Borland is wrong. you are wrong. > Anyone doubt me, try this code for reading in exactly one > line of text from a file: the Standard C Library already has a function to read in exactly one line: it is called fgets. > Make sure the next release of DJGPP fixes this bug. > > Thomas J. Hruska -- shinelight AT crosswinds DOT net > Shining Light Productions -- "Meeting the needs of fellow > programmers" > if you are going to have this kind of an attitude, at least change your signature line. Sinan. -- mailto:Sinan_Unur AT mail DOT com http://unur.com/