[ROOT] rfio file - how to check if it is already opened

From: Jiri Chudoba (Jiri.Chudoba@cern.ch)
Date: Thu Feb 14 2002 - 11:41:12 MET


Hello,

I use the following code to test is the file filename is already opened:

// check if the file was already opened by some other code
  TFile *f = static_cast<TFile *>(gROOT->FindObject(filename));

It works, but when I use rfio: prefix in the file name, I get an error
message:
Error in <TFile::cd>: No such file rfio:/castor/cern.ch/user/j/jchudoba/TESTPROD/00003/00097

It is because TDirectory::Get does cd to the filename.

#0  TDirectory::cd1 (this=0x8bd98b0, apath=0x7ffdda70
"rfio:/castor/cern.ch/user/j/jchudoba/TESTPROD/00003/00097") at
base/src/TDirectory.cxx:317
#1  0x2ab9cc29 in TDirectory::cd (this=0x8bd98b0, path=0x7ffdda70
"rfio:/castor/cern.ch/user/j/jchudoba/TESTPROD/00003/00097") at
base/src/TDirectory.cxx:276
#2  0x2ab9ee5e in TDirectory::Get (this=0x8bd98b0, namecycle=0x8bcea1c
"rfio:/castor/cern.ch/user/j/jchudoba/TESTPROD/00003/00097/galice.root") at
base/src/TDirectory.cxx:823
#3  0x2abc8fa0 in TROOT::FindObject (this=0x2aed3300, name=0x8bcea1c
"rfio:/castor/cern.ch/user/j/jchudoba/TESTPROD/00003/00097/galice.root") at
base/src/TROOT.cxx:520


What should I use to get rid of this error message?

         Thanks, cheers,
                               Jiri.

PS: root 3.02/07 on redhat 6.1

*************************************************************************
* E-mail address:  Jiri.Chudoba@cern.ch                                 *
* WWW Homepage  :  http://delphiwww.troja.mff.cuni.cz/chudoba/          *
* Telephone     :  +41 22 76 72288                                      *
* Fax           :  +41 22 76 79480                                      *
*************************************************************************



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