Re: [ROOT] Write objects to disc

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Jan 30 2002 - 12:10:23 MET


Hi Christian,

In your sub-directory mySubdir,
   mySubdir->cd();
you can write all the objects you want with:
    obj1->Write();
    obj2->Write(); etc
    mySubdir->Save(); //this will write all the keys

addind a file->Flush guarantees that all system buffers are written to disk

Rene Brun


cstrato@EUnet.at wrote:
> 
> Dear Rene
> 
> Suppose I have a TFile with a number of directories and subdirectories,
> and I want to store some objects in a subdirectory:
>    mySubDir->cd();
>    object1->Write();
>    object2->Write();
> 
> I would like to save these objects immediately to disc, without closing
> the TFile. Sorrowly, it is not quite clear to me when these objects are
> actually written to the subdirectory on the hard disc.
> Does method Write() write the objects to disc immediately, or do I have
> to call:
>    mySubDir->SetModified();
>    mySubDir->Save();
> or:
>    mySubDir->SaveSelf(kTRUE);
> or:
>    file->Flush();
> 
> Which of these methods would be preferrable?
> Do I have to use the same methods when I want to delete objects
> permanently from a subdirectory on hard disc?
> 
> Thank you inadvance for your help.
> 
> Best regards
> Christian
> ----------------------------------
> C.h.r.i.s.t.i.a.n  S.t.r.a.t.o.w.a
> V.i.e.n.n.a,  A.u.s.t.r.i.a



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:40 MET