Re: [ROOT] Root and RFIO, a suggestion for improvement

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Mon May 29 2000 - 20:12:34 MEST


Hi Jiri,

  the TWebFile, TNetFile and TRFIOFile all derive from TFile, but they
are not a TFile. To create any of these objects one should use the static
method TFile::Open(). This method returns one of the above objects depending
on the filename specified. Since all these objects derive from and have
the same interface as TFile, Open() returns a pointer to TFile. However,
the networked files have not the same size as TFile and therefore cannot
be created in the TFile ctor (also not all broken links are RFIO files).
The best is to use everywhere TFile::Open() in your macros.

I agree that the use of TFile::Open() should be mentioned in all TFile
derived ctors.

Cheers, Fons.



Jiri Masik wrote:
> 
> Hello,
> 
> I finally managed to read root files via rfio. I find the
> documentation(and also implementation) on this subject a bit
> confusing. Namely I would expect that any file can be opened by TFile
> constructor. It doesn't work as rfio:/pathname/file url seems to
> be interpreted as a local file by TFile::TFile. The description how to
> use an rfio file is given in the RFIOFile constructor in the reference
> guide but in fact TFile::Open method should be used for this purpose.
> 
> I think the TFile constructor could integrate RFIO access
> automatically as the staged file is represented by a broken link
> ->/shift/shd01/... on the local file system. One could try to interpret
> the filename as an RFIO address if a broken link of this type is
> encountered. The danger that one gets a distinct file than wishes is
> minimal and could be eliminated if this behaviour is only activated
> upon request. The win is that macros don't need to be changed when
> switching from local files to rfio. What is your opinion?
> cheers,
>         Jiri

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7677910



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:26 MET