delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/24/01:54:43

Date: Thu, 24 Aug 2000 08:55:35 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: r_maj AT poczta DOT onet DOT pl
Message-Id: <2110-Thu24Aug2000085534+0300-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.2.emacs20_6 I) and Blat ver 1.8.5b
CC: djgpp AT delorie DOT com
In-reply-to: <8o1930$36j$1@info.cyf-kr.edu.pl> (r_maj@poczta.onet.pl)
Subject: Re: binary I/O bug ?
References: <8o1930$36j$1 AT info DOT cyf-kr DOT edu DOT pl>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "Rafal Maj" <r_maj AT poczta DOT onet DOT pl>
> Newsgroups: comp.os.msdos.djgpp
> Date: Wed, 23 Aug 2000 21:34:22 +0200
> 
> I think ther is bug in I/O binary mode :

No, this isn't a bug.

> I can't open ofstream / ifstream in ios::binary mode.
> When I use :
>   ifstream plik;  plik.open("test.txt",ios::binary); plik<<"OK ;)";
> plik.close();
> then test.txt is empty. When I don't use ios::binary, then everything is OK.

See section 9.4 of the FAQ, it's all there: you need to say
"ios:binary | ios:out", and then it will work.

One of the libstdc++ maintainers explained some time ago that this is
how the C++ library is supposed to work.

> Where I can download new version of  DJGPP that don't have this bug,
> or how can I do workaround of this bug ?

Please don't jump to conclusions too quickly.  Most of the problems we
meet as programmers are our own bugs.

- Raw text -


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