CMS 3D CMS Logo

DavixStorageMaker.cc
Go to the documentation of this file.
6 #include <davix.hpp>
7 #include <unistd.h>
8 
10 public:
13  std::unique_ptr<Storage> open(const std::string &proto,
14  const std::string &path,
15  int mode,
16  AuxSettings const &aux) const override {
18  std::string newurl((proto == "web" ? "http" : proto) + ":" + path);
19  auto file = std::make_unique<DavixFile>(newurl, mode);
20  return f->wrapNonLocalFile(std::move(file), proto, std::string(), mode);
21  }
22 
23  bool check(const std::string &proto,
24  const std::string &path,
25  const AuxSettings &aux,
26  IOOffset *size = nullptr) const override {
27  std::string newurl((proto == "web" ? "http" : proto) + ":" + path);
28  Davix::DavixError *err = nullptr;
29  Davix::Context c;
30  Davix::DavPosix davixPosix(&c);
31  Davix::StatInfo info;
32  davixPosix.stat64(nullptr, newurl, &info, &err);
33  if (err) {
34  std::unique_ptr<Davix::DavixError> davixErrManaged(err);
35  cms::Exception ex("FileCheckError");
36  ex << "Check failed with error " << err->getErrMsg().c_str() << " and error code" << err->getStatus();
37  ex.addContext("Calling DavixFile::check()");
38  throw ex;
39  }
40  if (size) {
41  *size = info.size;
42  }
43  return true;
44  }
45 };
46 
size
Write out results.
std::unique_ptr< Storage > wrapNonLocalFile(std::unique_ptr< Storage > s, const std::string &proto, const std::string &path, int mode) const
static const TGPicture * info(bool iBackgroundIsBlack)
bool check(const std::string &proto, const std::string &path, const AuxSettings &aux, IOOffset *size=0) const override
static const StorageFactory * get(void)
std::unique_ptr< Storage > open(const std::string &proto, const std::string &path, int mode, AuxSettings const &aux) const override
double f[11][100]
void addContext(std::string const &context)
Definition: Exception.cc:165
int64_t IOOffset
Definition: IOTypes.h:19
#define DEFINE_EDM_PLUGIN(factory, type, name)
def move(src, dest)
Definition: eostools.py:511