From: "Alexei A. Frounze" Newsgroups: comp.os.msdos.djgpp Subject: Re: feof(FILE *) NOT portable... Date: Thu, 11 May 2000 16:31:06 +0400 Organization: MTU-Intel ISP Lines: 26 Message-ID: <391AA80A.240BF80C@mtu-net.ru> 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: ppp105-234.dialup.mtu-net.ru Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-Trace: gavrilo.mtu.ru 958048496 30216 212.188.105.234 (11 May 2000 12:34:56 GMT) X-Complaints-To: usenet-abuse AT mtu DOT ru NNTP-Posting-Date: 11 May 2000 12:34:56 GMT X-Mailer: Mozilla 4.72 [en] (Win95; I) X-Accept-Language: ru,en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com If you want somekind of feof() that can tell you is EOF reached or not independantly from reading functions, why don't you simply define your own? You always can obtain current position in a file and find the size of a file. So just compare the position with the size and you're done. Actually, I've been wondered by such a strange behaviour of feof() in the beginning of learning C too... Just because the EOF() function in Pascal is really independant from file reads and you may invoke EOF() at any moment you like. You'll be able to know is the EOF reached or not. But in C this function originally was defined in another manner. Anyway, that should not be a problem for a person capable to implement his/her own algorithm either avoiding LIBC functions or finding way to use LIBC functions. :) Just do it and don't complain about LIBC. Millions people use it and seems it's a way to go. :) Good Luck Alexei A. Frounze ----------------------------------------- Homepage: http://alexfru.chat.ru Mirror: http://members.xoom.com/alexfru