CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_6/src/IOPool/TFileAdaptor/src/TStorageFactorySystem.cc

Go to the documentation of this file.
00001 #include "IOPool/TFileAdaptor/interface/TStorageFactorySystem.h"
00002 #include "Utilities/StorageFactory/interface/StorageFactory.h"
00003 
00004 ClassImp(TStorageFactorySystem)
00005 
00006 
00007 TStorageFactorySystem::TStorageFactorySystem(const char *, Bool_t)
00008   : TSystem("-StorageFactory", "Storage Factory System"),
00009     fDirp(0)
00010 { SetName("StorageFactory"); }
00011 
00012 TStorageFactorySystem::TStorageFactorySystem(void)
00013   : TSystem("-StorageFactory", "Storage Factory System"),
00014     fDirp(0)
00015 { SetName("StorageFactory"); }
00016 
00017 TStorageFactorySystem::~TStorageFactorySystem(void)
00018 {}
00019 
00023 Int_t
00024 TStorageFactorySystem::MakeDirectory(const char */*name*/)
00025 {
00026   Error("MakeDirectory", "Unsupported");
00027   return -1;
00028 }
00029 
00030 void *
00031 TStorageFactorySystem::OpenDirectory(const char */*name*/)
00032 {
00033   Error("OpenDirectory", "Unsupported");
00034   return 0;
00035 }
00036 
00037 void
00038 TStorageFactorySystem::FreeDirectory(void */*dirp*/)
00039 {
00040   Error("FreeDirectory", "Unsupported");
00041 }
00042 
00043 const char *
00044 TStorageFactorySystem::GetDirEntry(void */*dirp*/)
00045 {
00046   Error("GetDirEntry", "Unsupported");
00047   return 0;
00048 }
00049 
00050 Bool_t
00051 TStorageFactorySystem::AccessPathName(const char *name, EAccessMode /* mode */)
00052 {
00053   // NB: This return reverse of check(): kTRUE if access *fails*
00054   return name ? !StorageFactory::get()->check(name) : kTRUE;
00055 }
00056 
00057 Int_t
00058 TStorageFactorySystem::Unlink(const char */*name*/)
00059 {
00060   Error("Unlink", "Unsupported");
00061   return 1;
00062 }
00063 
00064 Int_t
00065 TStorageFactorySystem::GetPathInfo(const char *name, FileStat_t &info)
00066 {
00067   info.fDev = 0;
00068   info.fIno = 0;
00069   info.fMode = 0644;
00070   info.fUid = 0;
00071   info.fGid = 0;
00072   info.fSize = 0;
00073   info.fMtime = 0;
00074 
00075   IOOffset storageSize;
00076   if (StorageFactory::get()->check(name, &storageSize))
00077   {
00078     info.fSize = storageSize;
00079     return 0;
00080   }
00081 
00082   return -1;
00083 }