From: horst DOT kraemer AT snafu DOT de (Horst Kraemer) Newsgroups: comp.os.msdos.djgpp Subject: Re: fstream bug? Date: Tue, 22 Sep 1998 13:23:19 GMT Organization: [Posted via] Interactive Networx Lines: 21 Message-ID: <36079fef.383440176@news.snafu.de> References: <360799C5 DOT 5FCA AT mi DOT aau DOT dk> NNTP-Posting-Host: n243-119.berlin.snafu.de To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Tue, 22 Sep 1998 14:36:21 +0200, Martin Juul wrote: >// filsplitter >A file made in this way get a size bigger than 40bytes if compiled by >gxx on dos(under win95) >it looks to mee like a serious bug in the fstream? >can anyone confirm that it poses a prob. to compile this under win95, >maybe solve it? You don't take into account that the number of characters in a text file on disk is usually not identical to the number of chars "read". An end of line is represented on disk by a byte sequence 13,10 (CRLF), while a stream in text mode will convert this sequence into a single char \n - and vice versa. Obviously among the 43 bytes read and written were 3 CRLF sequences which were represented as a single \n in your buffer. Regards Horst