This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
ofstream::seekp(0) does not work
- To: libstdc++ at sourceware dot cygnus dot com
- Subject: ofstream::seekp(0) does not work
- From: Bruno dot Voigt at ic3s dot de
- Date: Mon, 20 Dec 1999 15:20:57 +0100
Using the latest CVS version from today on a RH61 system (using gcc 2.95)
I have a problem writing records to a file via ofstream::write()/seekp().
open("xy", ios_base::out | ios_base::binary | ios_base::trunc);
It writes sequentially data to the file via ofstream::write().
At the end it calls ofstream::seekp(0) to position the file pointer back
to the top of the file, because it wants to update the header record.
But the call to ofstream::seekp(0) does not work.
The content of the following ofstream::write() call is appended to the
file.
ofstream::god() returns 1 and ofstream::fail() returns 0 when probed
directly after the seekp(0) call.
Any ideas that might be wrong?
The same source works when compiled with MSVC++6.
TIA, Bruno
--
Bruno.Voigt@ic3s.de # IC3S AG # Tel. 04106.655.105 # Fax. 04106.4618
____________________ # Mobile 0700.686.00.686