delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/24/03:22:24

Date: Thu, 24 Aug 2000 09:14:15 +0200 (WET)
From: Andris Pavenis <pavenis AT lanet DOT lv>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
cc: r_maj AT poczta DOT onet DOT pl, djgpp AT delorie DOT com
Subject: Re: binary I/O bug ?
In-Reply-To: <2110-Thu24Aug2000085534+0300-eliz@is.elta.co.il>
Message-ID: <Pine.A41.4.05.10008240909060.58156-100000@ieva06.lanet.lv>
MIME-Version: 1.0
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


On Thu, 24 Aug 2000, Eli Zaretskii wrote:

> > 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.

It's fixed in current CVS version of gcc-2.95 branch (which may sometimes
go into gcc-2.95.3 if such beast will be released). I also put related
patch in when build gcc-2.95.2 for DJGPP last time (end of March) but
didn't upload files. 

> 
> 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.
> 


Andris


- Raw text -


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