CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
XrdStorageMaker Class Reference
Inheritance diagram for XrdStorageMaker:
StorageMaker

Public Member Functions

virtual bool check (const std::string &proto, const std::string &path, IOOffset *size=0)
 
virtual Storageopen (const std::string &proto, const std::string &path, int mode)
 
virtual void stagein (const std::string &proto, const std::string &path)
 
- Public Member Functions inherited from StorageMaker
virtual void setTimeout (unsigned int timeout)
 
 StorageMaker (void)
 
virtual ~StorageMaker (void)
 

Detailed Description

Definition at line 7 of file XrdStorageMaker.cc.

Member Function Documentation

virtual bool XrdStorageMaker::check ( const std::string &  proto,
const std::string &  path,
IOOffset size = 0 
)
inlinevirtual

Reimplemented from StorageMaker.

Definition at line 32 of file XrdStorageMaker.cc.

References flags, and findQualityFiles::size.

35  {
36  std::string fullpath(proto + ":" + path);
37  XrdClientAdmin admin(fullpath.c_str());
38  if (! admin.Connect())
39  return false; // FIXME: Throw?
40 
41  long id;
42  long flags;
43  long modtime;
44  long long xrdsize;
45 
46  XrdOucString str(fullpath.c_str());
47  XrdClientUrlSet url(str);
48 
49  if (! admin.Stat(url.GetFile().c_str(), id, xrdsize, flags, modtime))
50  return false; // FIXME: Throw?
51 
52  *size = xrdsize;
53  return true;
54  }
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
int path() const
Definition: HLTadd.h:3
tuple size
Write out results.
virtual Storage* XrdStorageMaker::open ( const std::string &  proto,
const std::string &  path,
int  mode 
)
inlinevirtual

Open a storage object for the given URL (protocol + path), using the mode bits. No temporary files are downloaded.

Implements StorageMaker.

Definition at line 12 of file XrdStorageMaker.cc.

15  {
16  std::string fullpath(proto + ":" + path);
17  return new XrdFile (fullpath, mode);
18  }
int path() const
Definition: HLTadd.h:3
int mode
Definition: AMPTWrapper.h:139
Definition: XrdFile.h:9
virtual void XrdStorageMaker::stagein ( const std::string &  proto,
const std::string &  path 
)
inlinevirtual

Reimplemented from StorageMaker.

Definition at line 20 of file XrdStorageMaker.cc.

21  {
22  std::string fullpath(proto + ":" + path);
23  XrdClientAdmin admin(fullpath.c_str());
24  if (admin.Connect())
25  {
26  XrdOucString str(fullpath.c_str());
27  XrdClientUrlSet url(str);
28  admin.Prepare(url.GetFile().c_str(), kXR_stage | kXR_noerrs, 0);
29  }
30  }
int path() const
Definition: HLTadd.h:3