42 :
TNamed(path, ""), fRunType(type), fTypeOpt(opt)
69 const char *option,
const char *dsname)
81 if (option && strlen(option) > 0) {
122 if (dsname && strlen(dsname) > 0) {
150 Error(
"Init",
"problems asserting path '%s'", dirPath.
Data());
154 Warning(
"Init",
"not allowed to create files under '%s' - chrooting to '%s'",
155 dirPath.
Data(), dirData.Data());
156 dirPath.
Insert(0, dirData);
159 if (dirPath[0] !=
'/') dirPath.
Insert(0,
"/");
160 dirPath.
Insert(0, dirData);
161 }
else if (dirPath[0] ==
'.' || dirPath[0] ==
'~') {
163 if (dirPath[0] !=
'/') dirPath.
Insert(0,
"/");
164 dirPath.
Insert(0, dirData);
165 }
else if (dirPath.
IsNull()) {
174 if (!dirPath.
EndsWith(
"/")) dirPath +=
"/";
180 if (!dirPath.
EndsWith(
"/")) dirPath +=
"/";
184 if (!dirPath.
EndsWith(
"/")) dirPath +=
"/";
195 Error(
"Init",
"problems asserting path '%s'", dirPath.
Data());
214 if (!fileName.
EndsWith(
".root")) fileName +=
".root";
243 if (name && strlen(name) > 0) {
277 Error(
"AdoptFile",
"file is undefined or zombie!");
282 Error(
"AdoptFile",
"file end-point url is undefined!");
319 if(!list || list->
IsEmpty())
return 0;
329 Error(
"Merge",
"could not instantiate the file merger");
342 while((o = next())) {
355 Error(
"Merge",
"could not instantiate the file collection");
363 PDB(kOutput,2)
Info(
"Merge",
"dataset: %s (nfiles: %lld)", dataset->GetName(), dataset->GetNFiles());
364 if (dataset->GetNFiles() == 0) {
369 if (mssUrl.IsValid()) {
372 ur.SetHost(mssUrl.GetHost());
373 ur.SetPort(mssUrl.GetPort());
374 if (mssUrl.GetUser() && strlen(mssUrl.GetUser()) > 0)
375 ur.SetUser(mssUrl.GetUser());
388 while((o = next())) {
395 if (mssUrl.IsValid()) {
398 ur.SetHost(mssUrl.GetHost());
399 ur.SetPort(mssUrl.GetPort());
400 if (mssUrl.GetUser() && strlen(mssUrl.GetUser()) > 0)
401 ur.SetUser(mssUrl.GetUser());
413 PDB(kOutput,2)
Info(
"Merge",
"Done");
429 Info(
"Print",
" run type: create a merged file");
430 Info(
"Print",
" merging option: %s",
437 Info(
"Print",
" run type: create dataset (name: '%s', opt: '%s')",
442 Info(
"Print",
"-------------- %s : done -------------",
GetName());
458 Info(
"NotifyError",
"called with empty message");
469 if (merger && path) {
472 " error from TFileMerger::AddFile(%s)", path));
485 " error from TSystem::Unlink(%s)", path));
527 TIter nxp(&subPaths);
533 ::
Warning(
"TProofOutputFile::AssertDir",
"problems setting mode on '%s'", xpath.
Data());
535 ::Error(
"TProofOutputFile::AssertDir",
"problems creating path '%s'", xpath.
Data());
540 ::Warning(
"TProofOutputFile::AssertDir",
"could not get info for path '%s': will only try to create" 541 " the full path w/o trying to set the mode", existsPath.
Data());
543 ::Error(
"TProofOutputFile::AssertDir",
"problems creating path '%s'", existsPath.
Data());
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual const char * GetName() const
Returns name of object.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual const char * WorkingDirectory()
Return working directory.
void SetProtocol(const char *proto, Bool_t setDefaultPort=kFALSE)
Set protocol and, optionally, change the port accordingly.
Collectable string class.
void Print(Option_t *options="") const
Print information about this object.
void NotifyError(const char *errmsg)
Notify error message.
This class represents a WWW compatible URL.
TString & ReplaceAll(const TString &s1, const TString &s2)
static void FilterLocalroot(TString &path, const char *url="root://dum/")
If 'path' is local and 'dsrv' is Xrootd, apply 'path.Localroot' settings, if any. ...
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
const char * GetProtocol() const
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual void AddFirst(TObject *obj)
Add object at the beginning of the list.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Int_t AdoptFile(TFile *f)
Adopt a file already open.
const char * GetOptionsAnchor() const
static Int_t AssertDir(const char *dirpath)
Assert directory path 'dirpath', with the ownership of the last already existing subpath.
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
const char * GetOptions() const
Bool_t AddUrl(const char *url, Bool_t infront=kFALSE)
Add a new URL.
static void ResolveKeywords(TString &fname, const char *path=0)
Replace <ord>, <user>, <u>, <group>, <stag>, <qnum>, <file>, <rver> and <build> placeholders in fname...
TString & Insert(Ssiz_t pos, const char *s)
virtual int mkdir(const char *name, Bool_t recursive=kFALSE)
Make a file system directory.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
TFile * OpenFile(const char *opt)
Open the file using the unique temporary name.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
const char * GetFileName() const
const char * GetFile() const
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
The TNamed class is the base class for all named ROOT classes.
TUrl * GetFirstUrl() const
void Init(TClassEdit::TInterpreterLookupHelper *helper)
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
void SetOutputFileName(const char *name)
Set the name of the output file; in the form of an Url.
const char * GetDir(Bool_t raw=kFALSE) const
const char * GetAnchor() const
virtual Bool_t OutputFile(const char *url, Bool_t force)
Open merger output file.
void Print(Option_t *option="") const
Dump the class content.
TFileMerger * GetFileMerger(Bool_t local=kFALSE)
Get instance of the file merger to be used in 'merge' mode.
const char * GetSessionTag() const
const char * GetName() const
Returns name of object.
virtual Bool_t AddFile(TFile *source, Bool_t own, Bool_t cpProgress)
Add the TFile to this file merger and give ownership of the TFile to this object (unless kFALSE is re...
void SendAsynMessage(const char *msg, Bool_t lf=kTRUE)
Send an asychronous message to the master / client .
R__EXTERN TSystem * gSystem
static void GetLocalServer(TString &dsrv)
Extract LOCALDATASERVER info in 'dsrv'.
This class provides file copy and merging services.
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
virtual TEnvRec * Lookup(const char *n)
Loop over all resource records and return the one with name.
Collection abstract base class.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
char * Form(const char *fmt,...)
Class to steer the merging of files produced on the workers.
void Unlink(const char *path)
Unlink path.
Long64_t Merge(TCollection *list)
Merge objects from the list into this object.
TString & Remove(Ssiz_t pos)
virtual int Chmod(const char *file, UInt_t mode)
Set the file permission bits. Returns -1 in case or error, 0 otherwise.
virtual Bool_t IsEmpty() const
virtual ~TProofOutputFile()
Main destructor.
virtual const char * HostName()
Return the system's host name.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Mother of all ROOT objects.
virtual const TUrl * GetEndpointUrl() const
R__EXTERN TProofServ * gProofServ
Class that contains a list of TFileInfo's and accumulated meta data information about its entries...
TFileCollection * GetFileCollection()
Get instance of the file collection to be used in 'dataset' mode.
TFileCollection * fDataSet
Class describing a generic file including meta information.
const char * GetDataDir() const
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
void Init(const char *path, const char *dsname)
Initializer. Called by all constructors.
const char * GetOrdinal() const
const char * GetLocalHost() const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void AddFile(TFileMerger *merger, const char *path)
Add file to merger, checking the result.
virtual const char * GetTitle() const
Returns title of object.
const char * Data() const