CMS 3D CMS Logo

StorageMaker.cc
Go to the documentation of this file.
4 #include <cstdlib>
5 
6 void StorageMaker::stagein(const std::string & /*proto*/, const std::string & /*path*/, const AuxSettings &) const {}
7 
8 bool StorageMaker::check(const std::string &proto,
9  const std::string &path,
10  const AuxSettings &aux,
11  IOOffset *size /* = 0 */) const {
12  // Fallback method is to open the file and check its
13  // size. Because grid jobs run in a directory where
14  // there is usually more space than in /tmp, and that
15  // directory is automatically cleaned up, open up the
16  // temporary files in the current directory. If the
17  // file is downloaded, it will delete itself in the
18  // destructor or close method.
19  bool found = false;
21  if (auto s = open(proto, path, mode, aux)) {
22  if (size)
23  *size = s->size();
24 
25  s->close();
26 
27  found = true;
28  }
29 
30  return found;
31 }
size
Write out results.
virtual bool check(const std::string &proto, const std::string &path, const AuxSettings &aux, IOOffset *size=nullptr) const
Definition: StorageMaker.cc:8
virtual std::unique_ptr< Storage > open(const std::string &proto, const std::string &path, int mode, const AuxSettings &aux) const =0
virtual void stagein(const std::string &proto, const std::string &path, const AuxSettings &aux) const
Definition: StorageMaker.cc:6
int64_t IOOffset
Definition: IOTypes.h:19