
AMDG Robert McCullough wrote:
I am using Boost 1.43.0, Linux 2.6.23, gcc version 4.0.0 on a Freescale PowerPC.
I am reading in a serialized binary file using
Ifstream ifs; try { Ifs.open(filename.c_str(), iso_base::binary | iso_base::in); If(fs.is_open()) { Boost::archive::binary_iarchive ia(ifs); ia >> data; ifs.close(); } } catch (std:exception &e) { Ifs.close(); }
Sometimes it reads the file fine and sometimes it throws one of the following errors.
invalid_signature, Basic_string::resize, or stream error.
Does anyone have an idea why sometimes it works and sometimes it does not work?
a) Is the behavior consistent? i.e. does it yield different behavior for different archives, or can it yield different behavior for the same archive? b) What is data? c) How is the archive created d) Does it help if the archive is destroyed before the stream is closed? In Christ, Steven Watanabe