test
CMS 3D CMS Logo

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