www.delorie.com/djgpp/bugs/show.cgi   search  
Bug 000210

When Created: 03/02/1998 03:43:31
Against DJGPP version: 2.01
By whom: j.bosman@math.ruu.nl
Abstract: File data is erased when opened for random access
I opened a file using the following statements:

fstream ff;
ff.open("hallo.hoi" | ios::binary | ios::in | ios::out);

but the file data was erased after I opened it this way. 
It shouldn't be erased, because if you want to have it erased then you also 
have to give the option ios::trunc in the open mode.
Under Borland C++ it does work properly: the file is just opened for random 
access without being erased.
What can I do about this?

Johan Bosman 

Note added: 03/06/1998 04:57:09
By whom: pavenis@acad.latnet.lv
I met the same problem with class fpstream (part of TurboVision
port used in RHIDE) with C++ library from lgp272b.zip. Installing gcc 2.8.0
and lgpp280b.zip fixes the problem (Note name of libstdcx.a is now changed 
it is libstdcxx.a for 2.8.0, remove old one to avoid linking it accidentally)

Closed on 04/13/1999 07:00:55: This bug is in the C++ library; it is fixed in GCC 2.8.0 and later.
By whom: eliz@is.elta.co.il



  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2010   by DJ Delorie     Updated Jul 2010