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 
12 public:
13  std::unique_ptr<Storage> open(const std::string &proto,
14  const std::string &path,
15  int mode,
16  const AuxSettings &) const override {
18  StorageFactory::ReadHint readHint = f->readHint();
19  StorageFactory::CacheHint cacheHint = f->cacheHint();
20 
22  mode &= ~IOFlags::OpenUnbuffered;
23  else
25 
26  auto file = std::make_unique<File>(path, mode);
27  return f->wrapNonLocalFile(std::move(file), proto, path, mode);
28  }
29 
30  bool check(const std::string & /*proto*/,
31  const std::string &path,
32  const AuxSettings &,
33  IOOffset *size = nullptr) const override {
34  struct stat st;
35  if (stat(path.c_str(), &st) != 0)
36  return false;
37 
38  if (size)
39  *size = st.st_size;
40 
41  return true;
42  }
43 };
44 
size
Write out results.
CacheHint cacheHint(void) const
std::unique_ptr< Storage > wrapNonLocalFile(std::unique_ptr< Storage > s, const std::string &proto, const std::string &path, int mode) const
Definition: IOFlags.h:4
bool check(const std::string &, const std::string &path, const AuxSettings &, IOOffset *size=nullptr) const override
static const StorageFactory * get(void)
double f[11][100]
std::unique_ptr< Storage > open(const std::string &proto, const std::string &path, int mode, const AuxSettings &) const override
ReadHint readHint(void) const
int64_t IOOffset
Definition: IOTypes.h:19
#define DEFINE_EDM_PLUGIN(factory, type, name)
def move(src, dest)
Definition: eostools.py:511