CMS 3D CMS Logo

LocalStorageMaker.cc
Go to the documentation of this file.
1 #define _GNU_SOURCE 1
2 #define _FILE_OFFSET_BITS 64
7 #include <sys/types.h>
8 #include <sys/stat.h>
9 #include <unistd.h>
10 
11 namespace edm::storage {
13  public:
14  std::unique_ptr<Storage> open(const std::string &proto,
15  const std::string &path,
16  int mode,
17  const AuxSettings &) const override {
19  StorageFactory::ReadHint readHint = f->readHint();
20  StorageFactory::CacheHint cacheHint = f->cacheHint();
21 
23  mode &= ~IOFlags::OpenUnbuffered;
24  else
26 
27  auto file = std::make_unique<File>(path, mode);
28  return f->wrapNonLocalFile(std::move(file), proto, path, mode);
29  }
30 
31  bool check(const std::string & /*proto*/,
32  const std::string &path,
33  const AuxSettings &,
34  IOOffset *size = nullptr) const override {
35  struct stat st;
36  if (stat(path.c_str(), &st) != 0)
37  return false;
38 
39  if (size)
40  *size = st.st_size;
41 
42  return true;
43  }
44  };
45 } // namespace edm::storage
46 
47 using namespace edm::storage;
size
Write out results.
int64_t IOOffset
Definition: IOTypes.h:20
bool check(const std::string &, const std::string &path, const AuxSettings &, IOOffset *size=nullptr) const override
double f[11][100]
#define DEFINE_EDM_PLUGIN(factory, type, name)
static const StorageFactory * get(void)
std::unique_ptr< Storage > open(const std::string &proto, const std::string &path, int mode, const AuxSettings &) const override
def move(src, dest)
Definition: eostools.py:511