22 Aug
2008
22 Aug
'08
1:24 p.m.
On Aug 22, 2008, at 9:09 AM, Sachin Garg wrote:
I have a program which opens a boost fstream in binary input+output mode, creating the file if it doesn't exists. But writing doesn't works after reading, it must be something obvious that I am not aware f. filename is a wpath.
<snip> You most likely just need to reset the state of the stream. Once you reach EOF the corresponding flag is set accordingly and thus any further read/write operation will fail. Add a f.clear(); between the read and write statements and you should be fine. You may also need/want to adjust the position marker of the stream by using 'seekg()' accordingly. Ciao, Andreas