Mail Archives: djgpp/1997/08/07/22:46:30
Please help
DJGPP does not like my fstream.
I want to read and write binary with the read and write functions of fstream.
My open has: open( "saledb.dat", ios::in | ios::nocreate | ios::binary );
this means I can't write out though.
So I added ios::out, and it truncates the file on open, so I can't read.
The only way it allows out but doesn't truncate is to use | ios:app, but
then when I write it ALWAYS goes to the end of the file, no matter where I
seekp to.
I tried ios::ate instead of app but then it trunc's the file again. I also
tried & ~ios::trunc to stop trunc but it still trunc's it.
What is going on here ?
I realise that when I submit the assignment later on Unix I will have to
remove ios::binary
Thanks
Brett Porter
- Raw text -