Boost logo

Boost Users :

Subject: Re: [Boost-users] Serialization Question
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-06-08 19:18:15


Paul Dugas wrote:
> I'm looking into recording some data collected by one of my programs
> into rotating files. Something like so:
>
> ofstream ofs;
> boost::archive::text_oarchive oa(ofs)
> size_t rotate = 0;
> for(;;)
> {
> foo_t foo = get_some_foo();
> if (!rotate)
> {
> ofs.open(some_clever_new_filename);
> // attach oa again?
> rotate = 1000;
> }
> oa << foo;
> if (!--rotate)
> {
> ofs.close();
> // detach oa?
> }
> }
>
> Do I need to do anything to detach or re-attach the oarchive?
>
> Paul

can't re-use the same archive in tis case.

Robert Ramey


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