Boost logo

Boost Users :

Subject: Re: [Boost-users] binary serialization, what's missing
From: Avi Bahra (avibahra_at_[hidden])
Date: 2009-11-25 10:01:55


Jeff Wrote:
>Are the underlying streams opened as binary?
>
>Jeff

    Yes, This is how I save, the the restore is analogous.
    Using boost 1.39

    void save(bool binary) const {

        if (binary) {
            std::ofstream ofs( fileName_.c_str(), ios::binary );
            boost::archive::binary_oarchive oa( ofs );
            oa << *this;
        }
        else {
            std::ofstream ofs( fileName_.c_str() );
            boost::archive::text_oarchive oa( ofs );
            oa << *this;
        }
    }

    Ok I was trying eventually to use the portable binary archive, however I
suspect that would crash as well.
    I will try to create a standalone program that shows the crash using the
binary archive first.

  Best regards,
Ta,
   Avi



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net