RE: Linux directory heirarchy from within ROOT

From: Fine, Valeri <fine_at_bnl.gov>
Date: Thu, 31 Aug 2006 10:08:48 -0400


Hello Adam, Please check the macro
http://www.star.bnl.gov/cgi-bin/cvsweb.cgi/StRoot/macros/examples/SavePrimitive.C?rev=1.5  

It does something which is similar to want you want.

   // to get the full text follow the URL . . .   TString path = Path;
  TString dirname=0;
  Bool_t go = kFALSE;
  while (t = param()){
    path = Path;
    path += t->Path()->ReplaceAll("params/","");     cout << "path = " << path.Data() << endl;     if (t->HasData()){ // Table

      path += ".C";
      dirname = gSystem->DirName(path.Data());
      if (!gSystem->OpenDirectory(dirname.Data())) { 
        if (gSystem->mkdir(dirname.Data())) {
            cout << "Directoty " 

<< dirname
<< " creation failed"
<< endl;
} } ofstream *out = new ofstream(path.Data()); cout << "Open " << path.Data() << endl; t->SavePrimitive(*out,""); delete out;

    }
  }

Hope this helps, Valeri  


From: owner-roottalk_at_pcroot.cern.ch on behalf of Adam Roe Sent: Thu 8/31/2006 6:13 AM
To: roottalk_at_pcroot.cern.ch
Subject: [ROOT] Linux directory heirarchy from within ROOT

Hi ROOT-ers,
I'm sure this question has a simple answer, but i can't seem to find it.

Within my macro i create a large (>1000) number of canvases, and write them out to the working directory as .gif files. From inside this macro, I am trying to create a Linux (i.e. NOT a ROOT Browser) folder hierarchy to store these .gif files. I have not been able to get this to work. Any ideas? Effectively, I would like to use the Browser structure, but in the linux directory, not within a .root file.

Thanks,
Adam Received on Thu Aug 31 2006 - 16:14:13 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:00 MET