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 
7 {}
8 
10 {}
11 
12 void
13 StorageMaker::stagein (const std::string &/*proto*/,
14  const std::string &/*path*/)
15 {}
16 
17 void
18 StorageMaker::setTimeout (unsigned int /*timeout*/)
19 {}
20 
21 void
22 StorageMaker::setDebugLevel (unsigned int /*level*/)
23 {}
24 
25 bool
26 StorageMaker::check (const std::string &proto,
27  const std::string &path,
28  IOOffset *size /* = 0 */)
29 {
30  // Fallback method is to open the file and check its
31  // size. Because grid jobs run in a directory where
32  // there is usually more space than in /tmp, and that
33  // directory is automatically cleaned up, open up the
34  // temporary files in the current directory. If the
35  // file is downloaded, it will delete itself in the
36  // destructor or close method.
37  bool found = false;
39  if (Storage *s = open (proto, path, mode))
40  {
41  if (size)
42  *size = s->size ();
43 
44  s->close ();
45  delete s;
46 
47  found = true;
48  }
49 
50  return found;
51 }
Definition: Storage.h:8
virtual Storage * open(const std::string &proto, const std::string &path, int mode)=0
virtual bool check(const std::string &proto, const std::string &path, IOOffset *size=0)
Definition: StorageMaker.cc:26
virtual void setDebugLevel(unsigned int debugLevel)
Definition: StorageMaker.cc:22
list path
Definition: scaleCards.py:51
virtual void setTimeout(unsigned int timeout)
Definition: StorageMaker.cc:18
StorageMaker(void)
Definition: StorageMaker.cc:6
virtual void stagein(const std::string &proto, const std::string &path)
Definition: StorageMaker.cc:13
int64_t IOOffset
Definition: IOTypes.h:19
tuple size
Write out results.
virtual ~StorageMaker(void)
Definition: StorageMaker.cc:9