From: Brett Leslie Porter Message-Id: <199708080246.MAA21229@rabble.uow.edu.au> Subject: fstream simultaneous reading and writing To: djgpp AT delorie DOT com (DJGPP) Date: Fri, 8 Aug 1997 12:46:01 +1000 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk 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