Date: Thu, 24 Aug 2000 09:14:15 +0200 (WET) From: Andris Pavenis To: Eli Zaretskii 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: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk On Thu, 24 Aug 2000, Eli Zaretskii wrote: > > From: "Rafal Maj" > > 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