
"Russell Hind" <rh_gmane@mac.com> wrote in message news:cll9ma$fi4$1@sea.gmane.org...
There seems to be a problem on win32 where if you use a stream opened in text mode for a binary archive, you get errors. The following code asserts because 'd' appears to have a random value on the way back in.
If you open both streams in binary mode then the code runs fine. XML archives don't have the same problem.
I realise you shouldn't use a binary archive with a text stream, but is there anyway to catch this at compile or run time? Otherwise you just end up with a corrupted archive?
I looked hard for a way to determine whether a previously open stream was opened in binary or text mode. I was unable to find a way to do this - portable or otherwise. The assertion was the best I could do. Robert Ramey