Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-01 22:40:45

0001 #include "IOPool/TFileAdaptor/interface/TStorageFactorySystem.h"
0002 #include "Utilities/StorageFactory/interface/StorageFactory.h"
0003 
0004 ClassImp(TStorageFactorySystem);
0005 
0006 using namespace edm::storage;
0007 
0008 TStorageFactorySystem::TStorageFactorySystem(const char *, Bool_t)
0009     : TSystem("-StorageFactory", "Storage Factory System"), fDirp(nullptr) {
0010   SetName("StorageFactory");
0011 }
0012 
0013 TStorageFactorySystem::TStorageFactorySystem(void)
0014     : TSystem("-StorageFactory", "Storage Factory System"), fDirp(nullptr) {
0015   SetName("StorageFactory");
0016 }
0017 
0018 TStorageFactorySystem::~TStorageFactorySystem(void) {}
0019 
0020 //////////////////////////////////////////////////////////////////////
0021 //////////////////////////////////////////////////////////////////////
0022 //////////////////////////////////////////////////////////////////////
0023 Int_t TStorageFactorySystem::MakeDirectory(const char * /*name*/) {
0024   Error("MakeDirectory", "Unsupported");
0025   return -1;
0026 }
0027 
0028 void *TStorageFactorySystem::OpenDirectory(const char * /*name*/) {
0029   Error("OpenDirectory", "Unsupported");
0030   return nullptr;
0031 }
0032 
0033 void TStorageFactorySystem::FreeDirectory(void * /*dirp*/) { Error("FreeDirectory", "Unsupported"); }
0034 
0035 const char *TStorageFactorySystem::GetDirEntry(void * /*dirp*/) {
0036   Error("GetDirEntry", "Unsupported");
0037   return nullptr;
0038 }
0039 
0040 Bool_t TStorageFactorySystem::AccessPathName(const char *name, EAccessMode /* mode */) {
0041   // NB: This return reverse of check(): kTRUE if access *fails*
0042   return name ? !StorageFactory::get()->check(name) : kTRUE;
0043 }
0044 
0045 Int_t TStorageFactorySystem::Unlink(const char * /*name*/) {
0046   Error("Unlink", "Unsupported");
0047   return 1;
0048 }
0049 
0050 Int_t TStorageFactorySystem::GetPathInfo(const char *name, FileStat_t &info) {
0051   info.fDev = 0;
0052   info.fIno = 0;
0053   info.fMode = 0644;
0054   info.fUid = 0;
0055   info.fGid = 0;
0056   info.fSize = 0;
0057   info.fMtime = 0;
0058 
0059   IOOffset storageSize;
0060   if (StorageFactory::get()->check(name, &storageSize)) {
0061     info.fSize = storageSize;
0062     return 0;
0063   }
0064 
0065   return -1;
0066 }