Newsgroups: comp.os.msdos.djgpp X-Comment-To: Horst Kraemer From: Oleg Ossovitskii Date: Sun, 01 Aug 99 09:00:25 +0300 Subject: Re^2: Bug of feature? Message-ID: <933501866@p20.f44.n478.z2.FidoNet.ftn> References: <1724295273 AT news DOT snafu DOT de> Organization: Without C we'd have BASI, PASAL, OBOL ;-) X-FTN-AREA: HURRICANE.COMP.OS.MSDOS.DJGPP X-FTN-MSGID: 2:478/44 DOT 20 AT FidoNet DOT org 37a41baa X-FTN-REPLY: news.snafu.de 66c6a869 X-FTN-PID: GED386 3.0.1-asa7 X-FTN-CHRS: IBMPC 2 X-FTN-RealName: οΜΕΗ οΜΕΗΟΧΙή οΣΟΧΙΓΛΙΚ ICQ UIN: 28860835 X-FTN-NickName: Stryker X-FTN-Location: Kalinigrad, West Russia X-FTN-GC: Geek-R 1.3 GPR/CC/IT/* a20 d- H- s++:- C++ c2 hw- B- F I cc pn++ D++ X-FTN-GC: O U- W+ M pr+ ln++ sl sw+ PS+ PE+ eq+ Y+ h+ sx++ b+:++ g3 m++ R- tv- X-FTN-GC: hu e:++ E:- mt+ ph+ UF co+ ck- ho- n p r x+ A+ he-- sm- sp- X-FTN-Tearline: Microsoft FidoNet Explorer/386 3.0.1-asa7 -={SCS.METALSPORT $$ }=- X-FTN-Origin: Without C we'd have BASI, PASAL, OBOL ;-) (2:478/44.20) X-FTN-SEEN-BY: 478/44 X-FTN-PATH: 478/44 X-FTN-PATH: 478/44 Lines: 33 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hello, Horst, how do You do? On 31 Jul 99, 18:19 Horst Kraemer (horst DOT kraemer AT snafu DOT de) wrote to Oleg Ossovitskii >> // in Borland C++ all works correctly, but in Djgpp >> // file split on pieces on 16KB only ! Why? This is bug or [skip] HK> It's neither a bug or feature of DJGPP but it is a bug or feature of HK> your program. Please test this program with BORLAND and DJGPP :) You right! Thanks. But with Borland compiler my program really works. Mystcism ;) HK> /* fflush(f); */ Yes, I forgot this feature :) HK> It will display 0 even with BCC, does it ? Yes. HK> The problem is that your FILE is buffered and filelength doesn't know. HK> So filelength will always display the length of the file as committed HK> to DOS. If you want to record the correct filelength after every fputs HK> or fwrite you have to flush the FILE via 'fflush(f)' before calling HK> filelength. Thanks again. WBR, Oleg Ossovitskii MailTo: stryker AT kaliningrad DOT ru PGP key fingerprint: 54F5 065A B916 D43C 49BA 4E1F F0DD 67C4 CBC6 422F ... Girlfriend pregnant - (M)arry (I)gnore (A)bort