library: libGFAL
#include "TGFALFile.h"

TGFALFile


class description - source file - inheritance tree (.pdf)

class TGFALFile : public TFile

Inheritance Chart:
TObject
<-
TNamed
<-
TDirectory
<-
TFile
<-
TGFALFile
    private:
TGFALFile() virtual Int_t SysClose(Int_t fd) virtual Int_t SysOpen(const char* pathname, Int_t flags, UInt_t mode) virtual Int_t SysRead(Int_t fd, void* buf, Int_t len) virtual Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence) virtual Int_t SysStat(Int_t fd, Long_t* id, Long64_t* size, Long_t* flags, Long_t* modtime) virtual Int_t SysSync(Int_t) virtual Int_t SysWrite(Int_t fd, const void* buf, Int_t len) public:
TGFALFile(const char* url, Option_t* option = "", const char* ftitle = "", Int_t compress = 1) ~TGFALFile() static TClass* Class() virtual TClass* IsA() const virtual Bool_t ReadBuffer(char* buf, Int_t len) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) virtual Bool_t WriteBuffer(const char* buf, Int_t len)

Data Members

    private:
TUrl fUrl URL of file Bool_t fStatCached ! (transient) is file status cached? TGFALFile::stat64 fStatBuffer ! (transient) Cached file status buffer (for performance)

Class Description

                                                                      
 TGFALFile                                                            
                                                                      
 A TGFALFile is like a normal TFile except that it reads and writes   
 its data via the underlaying Grid access mechanism.                  
 TGFALFile file names are either a logical file name, a guid, an      
 SURL or a TURL, like:                                                
                                                                      
    gfal:/lfn/user/r/rdm/galice.root                                  
                                                                      
 Grid storage interactions today require using several existing       
 software components:                                                 
  - The replica catalog services to locate valid replicas of          
    files.                                                            
  - The SRM software to ensure:                                       
     - files  exist on disk (they are recalled from mass              
       storage if necessary) or                                       
     - space is allocated on disk for new files (they are possibly    
       migrated to mass storage later)                                
  - A file access mechanism to access files from the storage          
    system on the worker node.                                        
                                                                      
 The GFAL library hides these interactions and presents a Posix       
 interface for the I/O operations. The currently supported protocols  
 are: file for local access, dcap, gsidcap and kdcap (dCache access   
 protocol) and rfio (CASTOR access protocol).                         
                                                                      
 File naming convention:                                              
 A file name can be a Logical File Name (LFN), a Grid Unique          
 IDentifier (GUID), a file replica (SURL) or a Transport file         
 name (TURL):                                                         
                                                                      
     an LFN starts with lfn:                                          
        for example lfn:baud/testgfal15                               
                                                                      
     a GUID starts with guid:                                         
        for example guid:2cd59291-7ae7-4778-af6d-b1f423719441         
                                                                      
     an SURL starts with srm://                                       
         for example srm://wacdr002d.cern.ch:8443/castor/             
                    cern.ch/user/b/baud/testgfal15                    
                                                                      
      a TURL starts with a protocol name:                             
          for example rfio:////castor/cern.ch/user/b/baud/testgfal15  
                                                                      
 Note that for the TGFALFile plugin to work, all these pathnames      
 should be prepended by gfal:.                                        
                                                                      


TGFALFile(const char *url, Option_t *option, const char *ftitle, Int_t compress) : TFile(url, "NET", ftitle, compress), fUrl(url)
 Create a GFAL file object. A GFAL file is the same as a TFile
 except that it is being accessed via the underlaying Grid access
 mechanism. The url argument must be of the form: gfal:/lfn/file.root
 If the file specified in the URL does not exist, is not accessable
 or can not be created the kZombie bit will be set in the TGFALFile
 object. Use IsZombie() to see if the file is accessable.
 For a description of the option and other arguments see the TFile ctor.
 The preferred interface to this constructor is via TFile::Open().

~TGFALFile()
 GFAL file dtor. Close and flush directory structure.

Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode)
 Interface to system open. All arguments like in POSIX open.

Int_t SysClose(Int_t fd)
 Interface to system close. All arguments like in POSIX close.

Int_t SysRead(Int_t fd, void *buf, Int_t len)
 Interface to system read. All arguments like in POSIX read.

Int_t SysWrite(Int_t fd, const void *buf, Int_t len)
 Interface to system write. All arguments like in POSIX write.

Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence)
 Interface to system lseek. All arguments like in POSIX lseek
 except that the offset and return value are Long_t to be able to
 handle 64 bit file systems.

Int_t SysStat(Int_t /*fd*/, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime)
 Interface to TSystem:GetPathInfo(). Generally implemented via
 stat() or fstat().

Bool_t ReadBuffer(char *buf, Int_t len)
 Read specified byte range from remote file via GFAL.
 Returns kTRUE in case of error.

Bool_t WriteBuffer(const char *buf, Int_t len)
 Write specified byte range to remote file via GFAL.
 Returns kTRUE in case of error.



Inline Functions


              Int_t SysSync(Int_t)
          TGFALFile TGFALFile(const char* url, Option_t* option = "", const char* ftitle = "", Int_t compress = 1)
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void Streamer(TBuffer& b)
               void StreamerNVirtual(TBuffer& b)


Author: Fons Rademakers 8/12/2005
Last update: root/gfal:$Name: $:$Id: TGFALFile.cxx,v 1.3 2006/02/24 08:55:26 brun Exp $
Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.