Boost logo

Boost Users :

Subject: [Boost-users] [serialization] appending to an archive
From: hurcan solter (hsolter_at_[hidden])
Date: 2009-05-23 11:12:54


I am trying to append one or more records to the existing archive file,
using something like this;

void Logger::save(const std::string& fileName)
{
    assert(fileName != "logger.dmp");
    bp::time_duration endRecordTime = getCurrentTime();

    ofs.flush();
    path dst = complete(path(fileName, native));
    path src = complete(path("logger.dmp", native));
    remove(dst);
    copy_file(src, dst);

    ofstream saveFile(dst,std::ios::app);
    ArchiveType archive(saveFile,boost::archive::no_header);
    *mArchive << endRecordTime
}

although i specify no_header flag, it inserts a '0' as a preamble,
how can i turn it off? have you guys ever needed to use serialization
like this? what was your solution

Thanks in advance
Hurcan



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