Re: [ROOT] any better way?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Oct 26 2001 - 11:25:52 MEST


Hi,

I do not see any changes between version 3.0 and 3.01 that could affect you.
Are you following teh conventions described in TDirectory::Cd ?

Anyhow, there is a better solution. Simply do;

    TDirectory *newdir = f->mkdir(lastdir, lastdir);
    newdir->cd();

Rene Brun

Mei Wen wrote:
> 
>    Part 1.1       Type: Plain Text (text/plain)
>               Encoding: base64
Dear rooters,
    I have a question during the upgrade of root version to v3.01 for monitoring
tools of KLOE. We need to create a TFile including many branches consist of
thousands of histograms. In the old version we did in this way:

    TFile *f;
    char lastdir[4096];

 // "lastdir" is the current subdir need to be created. the program gets
"lastdir" from the server via network. then

     f->mkdir(lastdir, lastdir);
     f->Cd(lastdir);

// then fowllowing this way until the end of all subdir created

But now with v3.01 it doesn't work. After long time debugging the program it
seems to me that I have to create the absolute dir including parents before
calling the function Cd(lastdir), otherwise the Cd(lastdir) does nothing. This
change makes the program much more complicated than before. Maybe I did not find
the easy way to do this job. Could you tell me if I was wrong?

   cheers



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:04 MET