delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/22/09:30:39

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

On Tue, 22 Sep 1998 14:36:21 +0200, Martin Juul <mj AT mi DOT aau DOT dk> 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019