53 LsTreeEntry_t(
const char *
g,
const char *u,
const char *cs,
const char *ls,
Long64_t m) :
66 const char *user,
const char *ins)
114 "could not attach to a valid the dataset dir; paths tried:");
139 "problems setting perms of dataset directory %s (#%d)",
169 lockloc +=
"?filetype=raw";
171 if (
f && !(
f->IsZombie())) {
172 const Int_t blen = 8192;
176 Long64_t len = (rest > blen - 1) ? blen - 1 : rest;
177 if (
f->ReadBuffer(buf, len)) {
190 Warning(
"Init",
"could not open remore file '%s' with the lock location", lockloc.
Data());
259 "non-default local cache directory '%s' could not be created"
267 "non-default local cache directory '%s' is not writable"
268 " - switching to default",
290 "local cache directory '%s' could not be created"
297 "local cache directory '%s' is not writable - disabling cache",
323 if (!ins || strlen(ins) <= 0)
return;
328 while (
s.Tokenize(tok, from,
" ")) {
333 if (tok ==
"perms:open")
362 const char *ext = (!strcmp(dsName,
"ls")) ?
".txt" :
".root";
372 Info(
"GetDataSetPath",
"paths: %s, %s ", result.
Data(), md5path.
Data());
383 const char *dsName,
Long_t mtime,
const char *checksum)
390 Warning(
"NotifyUpdate",
"problems (re-)creating the dataset lists for '/%s/%s'",
399 TMD5 *oldMd5 = 0, *newMd5 = 0;
411 if (!strcmp(checksum,
"removed")) {
419 if (!strcmp(checksum,
"removed")) {
420 Warning(
"NotifyUpdate",
"entry for removed dataset '%s' not found!", dspath.
Data());
449 "can't set permissions of dataset list file %s (#%d)",
458 if (oldMd5 && (*newMd5 == *oldMd5))
487 Error(
"CreateLsFile",
"problems redirecting output to %s (errno: %d)",
497 Error(
"CreateLsFile",
"problems restoring output to standard streams (errno: %d)",
508 Error(
"CreateLsFile",
"problems unlinking old file '%s' (errno: %d)",
516 Error(
"CreateLsFile",
"problems renaming '%s' to '%s' (errno: %d)",
524 if (chown(lsfile.
Data(), udirst.
fUid, udirst.
fGid) != 0) {
525 Warning(
"CreateLsFile",
"problems setting ownership on file '%s' (errno: %d)",
531 "can't set permissions of list file %s (#%d)",
535 else if (chmod(lsfile.
Data(), 0644) != 0) {
536 Warning(
"CreateLsFile",
"problems setting permissions on file '%s' (errno: %d)",
544 Error(
"CreateLsFile",
"problems calculating checksum for '%s'", lsfile.
Data());
551 Error(
"CreateLsFile",
"problems unlinking temp file '%s' (errno: %d)",
595 if (printing || updating)
600 Error(
"BrowseDataSets",
601 "only one of kPrint, kQuotaUpdate, kExport or kList can be specified at once");
607 TMap *outmap = (fillmap || exporting || listing) ? (
TMap *)target : (
TMap *)0;
610 TRegexp rg(
"^[^./][^/]*.root$");
613 if (dsName && strlen(dsName) > 0) reds =
new TRegexp(dsName,
kTRUE);
615 TMap *userMap = 0, *datasetMap = 0;
617 const char *dsEnt = 0;
624 if (reds && datasetName.
Index(*reds) ==
kNPOS)
continue;
627 Info(
"GetDataSets",
"found dataset %s of user %s in group %s",
632 Error(
"GetDataSets",
"dataset %s (user %s, group %s) could not be opened",
642 const char *mapGroup =
group;
645 const char *mapUser = user;
649 if (fillmap && !listing && outmap) {
650 if (!(userMap =
dynamic_cast<TMap*
> (outmap->
GetValue(mapGroup)))) {
656 if (!(datasetMap =
dynamic_cast<TMap*
> (userMap->
GetValue(mapUser)))) {
657 datasetMap =
new TMap;
667 TString dsNameFormatted(
Form(
"/%s/%s/%s", mapGroup,
668 mapUser, datasetName.
Data()));
672 }
else if (updating) {
675 GetQuota(mapGroup, mapUser, datasetName.
Data(), fileList);
677 }
else if (printing) {
681 TString dsNameFormatted(
Form(
"/%s/%s/%s", mapGroup,
682 mapUser, datasetName.
Data()));
684 if (dsNameFormatted.
Length() < 42)
685 dsNameFormatted.
Resize(42);
695 }
else if (listing) {
703 if (fillmap && datasetMap)
704 datasetMap->Add(
new TObjString(datasetName), fileList);
743 const char *dsName,
UInt_t option)
759 if (user && (strcmp(user,
"*") == 0 || !user[0]))
772 Error(
"GetDataSets",
"only one of '?P', '?Q', '?E' or '?L' can be specified at once");
782 }
else if (exporting || !updating || listing) {
797 Warning(
"GetDataSets",
"problems recreating 'ls' info for {%s,%s}",
799 }
else if (!printing || forcescan || (printing &&
806 if (!notCommonUser) notCommonUser =
kTRUE;
812 if (user &&
group && strchr(user,
'*') && strchr(
group,
'*')) {
815 Warning(
"GetDataSets",
"problems recreating 'ls' info for {%s,%s}",
817 }
else if (!printing || forcescan || (printing &&
821 if (!printing)
return (
TMap *)result;
826 if (printing && !forcescan &&
830 TString locupdate, dsn, grp, usr;
853 void *dataSetDir = 0;
859 if (strcmp(eg,
".") == 0 || strcmp(eg,
"..") == 0)
881 if (strcmp(
eu,
".") == 0 || strcmp(
eu,
"..") == 0)
890 Warning(
"GetDataSets",
"problems recreating 'ls' info for {%s,%s}",
892 }
else if (!printing || forcescan || (printing &&
913 Printf(
"Dataset URI | # Files | Default tree | # Events | Disk | Staged");
917 while ((os =
dynamic_cast<TObjString*
> (iter4()))) {
934 return (
TMap *)result;
947 if (!
group || strlen(
group) <= 0 || !user || strlen(user) <= 0 || !out) {
948 Error(
"FillLsDataSet",
"at least one of the inputs is invalid (%s,%s,%p)",
group, user, out);
965 Info(
"FillLsDataSet",
"file '%s' does not exists", lsfile.
Data());
969 Warning(
"FillLsDataSet",
"file '%s' exists cannot be read (permission denied)", lsfile.
Data());
973 if (dsname && strlen(dsname) > 0) {
977 Error(
"FillLsDataSet",
"could not initialize TMacro from '%s'", lsfile.
Data());
996 Info(
"FillLsDataSet",
"no match for dataset uri '/%s/%s/%s'",
group, user, dsname);
1033 Info(
"GetDataSet",
"dataset %s does not exist", path.
Data());
1043 Info(
"GetDataSet",
"file '%s' does not exists", path.
Data());
1047 Warning(
"GetDataSet",
"file '%s' exists cannot be read (permission denied)", path.
Data());
1056 Error(
"GetDataSet",
"could not get checksum of %s from %s", path.
Data(), md5path.
Data());
1063 Error(
"GetDataSet",
"could not open file %s", path.
Data());
1086 const char *dsName,
UInt_t option)
1089 static TMacro *uptmac = 0;
1091 TString locupdtim, locupdate, remupdate;
1101 need_last_update =
kFALSE;
1105 if (need_last_update) {
1107 Error(
"CheckLocalCache",
"cannot get info for remote file '%s' - ignoring", remupdate.
Data());
1111 need_last_update =
kFALSE;
1113 need_last_update =
kTRUE;
1118 "cannot set modification time on file '%s' (errno: %d)",
1124 if (need_last_update) {
1126 Error(
"CheckLocalCache",
"cannot get remote file '%s' - ignoring", remupdate.
Data());
1131 Warning(
"CheckLocalCache",
"cannot set modification time on file '%s' (errno: %d)",
1136 FILE *ftim = fopen(locupdtim.
Data(),
"w");
1138 Warning(
"CheckLocalCache",
"problems create file '%s' (errno: %d)",
1141 if (fclose(ftim) != 0)
1142 Warning(
"CheckLocalCache",
"problems close file '%s' (errno: %d)",
1146 "cannot set modification time on file '%s' (errno: %d)",
1152 uptmac =
new TMacro(locupdate);
1156 FILE *ftim = fopen(locupdtim.
Data(),
"w");
1158 Warning(
"CheckLocalCache",
"problems create file '%s' (errno: %d)",
1161 if (fclose(ftim) != 0)
1162 Warning(
"CheckLocalCache",
"problems close file '%s' (errno: %d)",
1167 "cannot set modification time on file '%s' (errno: %d)",
1170 Warning(
"CheckLocalCache",
"cannot get info for file '%s'"
1171 " - will not touch '%s'", locupdate.
Data(), locupdtim.
Data());
1175 if (!uptmac) uptmac =
new TMacro(locupdate);
1179 if (!dsName || strlen(dsName) <= 0)
1183 TString ds, locpath, path, locmd5path, md5path, remmd5s;
1188 ds.
Form(
"/%s/%s/%s",
group, user, dsName);
1192 if (strcmp(dsName,
"ls"))
1193 Warning(
"CheckLocalCache",
"dataset '%s' does not exists anymore", ds.
Data());
1200 if (!
s.IsDigit() &&
s != ds) {
1204 if (remmd5s ==
"---") {
1206 if (strcmp(dsName,
"ls"))
1207 Warning(
"CheckLocalCache",
"dataset '%s' does not exists anymore", ds.
Data());
1216 Warning(
"CheckLocalCache",
"cannot get checksum of '%s' - assuming match failed", ds.
Data());
1217 need_update =
kTRUE;
1223 need_update =
kTRUE;
1229 Error(
"CheckLocalCache",
"cannot get remote file '%s' - ignoring", path.
Data());
1236 Warning(
"CheckLocalCache",
"checksum for freshly downloaded file '%s' does not match the"
1239 Warning(
"CheckLocalCache",
"problems saving checksum to '%s' (errno: %d)",
1242 Warning(
"CheckLocalCache",
"problems calculating checksum for '%s'", locpath.
Data());
1258 Error(
"ClearCache",
"cannot open directory '%s' (errno: %d)",
1263 if (uri && strlen(uri) > 0) {
1264 if (strcmp(uri,
"*") && strcmp(uri,
"/*") && strcmp(uri,
"/*/") &&
1265 strcmp(uri,
"/*/*") && strcmp(uri,
"/*/*/") && strcmp(uri,
"/*/*/*")) {
1268 if (u(0) ==
'/') u.
Remove(0,1);
1286 if (!strcmp(
e,
".") || !strcmp(
e,
".."))
continue;
1293 Warning(
"ShowCache",
"problems 'stat'-ing '%s' (errno: %d)",
1302 Warning(
"ClearCache",
"problems unlinking '%s' (errno: %d)",
1310 Printf(
" %lld bytes (%lld files) have been freed", totsz, nf);
1324 Error(
"ShowCache",
"cannot open directory '%s' (errno: %d)",
1329 if (uri && strlen(uri) > 0) {
1330 if (strcmp(uri,
"*") && strcmp(uri,
"/*") && strcmp(uri,
"/*/") &&
1331 strcmp(uri,
"/*/*") && strcmp(uri,
"/*/*/") && strcmp(uri,
"/*/*/*")) {
1334 if (u(0) ==
'/') u.
Remove(0,1);
1345 Printf(
" Last modified Size(bytes) File");
1353 if (!strcmp(
e,
".") || !strcmp(
e,
".."))
continue;
1360 Warning(
"ShowCache",
"problems 'stat'-ing '%s' (errno: %d)",
1377 Printf(
" %lld files, %lld bytes", nf, totsz);
1398 TString md5path, path, md5sum;
1406 if (checkIfExists) {
1411 Info(
"WriteDataSet",
"Dataset disappeared. Discarding update.");
1420 Error(
"WriteDataSet",
"Could not get checksum of %s", path.
Data());
1424 Bool_t checksumAgrees = (*checksum == *checksum2);
1427 if (!checksumAgrees) {
1429 Info(
"WriteDataSet",
"Dataset changed. Discarding update.");
1437 while (tempFile.
Index(
"/", index+1) >= 0)
1438 index = tempFile.
Index(
"/", index+1);
1440 tempFile.
Insert(index+1,
".");
1444 Error(
"WriteDataSet",
"Could not open dataset for writing %s", tempFile.
Data());
1464 Error(
"WriteDataSet",
"renaming %s to %s failed; dataset might be corrupted",
1468 Error(
"WriteDataSet",
"unlink of %s failed", md5path.
Data());
1474 "can't set permissions of dataset file %s (#%d)",
1481 Error(
"WriteDataSet",
"problems calculating checksum of %s", path.
Data());
1487 "can't set permissions of dataset MD5 checksum file %s (#%d)",
1494 Error(
"WriteDataSet",
"could not 'stat' the version of '%s'!", path.
Data());
1502 Warning(
"WriteDataSet",
"problems notifying update with 'NotifyUpdate'");
1513 const char *md5path,
TString &checksum)
1517 if (!path || strlen(path) <= 0 || !md5path || strlen(md5path) <= 0) {
1518 Error(
"ChecksumDataSet",
"one or more inputs are invalid ('%s','%s')",
1525 Error(
"ChecksumDataSet",
"problems calculating checksum of '%s'", path);
1530 Error(
"ChecksumDataSet",
"problems saving checksum to '%s'", md5path);
1554 Warning(
"RemoveDataSet",
"problems removing main file '%s' (errno: %d)",
1558 Warning(
"RemoveDataSet",
"problems removing chcksum file '%s' (errno: %d)",
1565 Warning(
"RemoveDataSet",
"problems notifying update with 'NotifyUpdate'");
1608 Error(
"RegisterDataSet",
"problem parsing uri: %s", uri);
1624 "dataset '%s' claimed to exists but retrieval failed - ignoring", uri);
1625 dataSet = newDataSet;
1628 dataSet->
Add(newDataSet);
1635 Error(
"RegisterDataSet",
"dataset '%s' exists already", uri);
1644 uniqueFileList->
Add(prevFile);
1647 if (!uniqueFileList->
FindObject(obj->GetFirstUrl()->GetUrl()))
1648 uniqueFileList->
Add(obj);
1658 delete uniqueFileList;
1664 Warning(
"RegisterDataSet",
"configured to not trust the information"
1665 " provided by users: ignoring request");
1682 Error(
"RegisterDataSet",
"problems verifying the dataset");
1686 Warning(
"RegisterDataSet",
"user-driven verification not allowed: ignoring request");
1695 Error(
"RegisterDataSet",
"datasets without size information are not accepted:");
1697 Error(
"RegisterDataSet",
"you may want to define an average"
1698 " file size to get an estimated dataset size");
1706 Info(
"RegisterDataSet",
"your group %s uses %.1f GB + %.1f GB for the new dataset; "
1707 "the available quota is %.1f GB",
fGroup.
Data(),
1712 Error(
"RegisterDataSet",
"quota exceeded");
1719 Error(
"RegisterDataSet",
"could not write dataset: %s", dsName.
Data());
1722 return ((success) ? 0 : -1);
1737 if (!dataset)
return -1;
1741 return (rc == 0) ? -1 : 0;
1753 if (!fcs)
return -1;
1755 Int_t ndisappeared = 0;
1759 if (!(
d->GetString().IsNull())) {
1765 Warning(
"ScanDataSet",
"problems processing dataset: %s",
d->GetName());
1768 Warning(
"ScanDataSet",
"empty string found in map while processing: %s", uri);
1772 return ndisappeared;
1784 const char *dsName,
UInt_t option)
1799 if ((option &
kReopen)) fopt++;
1800 if ((option &
kTouch)) fopt++;
1805 Warning(
"ScanDataSet",
"kAllFiles mode: ignoring kStagedFiles or kReopen"
1806 " or kTouch requests");
1815 Error(
"ScanDataSet",
"kLocateOnly and kStageOnly cannot be processed concurrently");
1821 Warning(
"ScanDataSet",
"kNoAction mode: ignoring kLocateOnly or kStageOnly requests");
1861 TString dsUser, dsGroup, dsName;
1863 if (((option &
kPrint) || (option &
kExport)) && strlen(uri) <= 0)
1867 return GetDataSets(dsGroup, dsUser, dsName, option);
1876 TString dsUser, dsGroup, dsName, ss(opts);
1879 if (!strchr(uri,
'*')) {
1880 if (!
ParseUri(uri, &dsGroup, &dsUser, &dsName))
return fc;
1887 if (!fcs)
return fc;
1937 if (rc)
return kTRUE;
1938 Error(
"RemoveDataSet",
"error removing dataset %s", dsName.
Data());
1949 TString dsUser, dsGroup, dsName;
1951 if (
ParseUri(uri, &dsGroup, &dsUser, &dsName))
const char *const kDataSet_LocalCache
const char *const kDataSet_DataSetList
const char *const kDataSet_LockLocation
char * Form(const char *fmt,...)
void Printf(const char *fmt,...)
Bool_t R_ISDIR(Int_t mode)
R__EXTERN TSystem * gSystem
static struct mg_connection * fc(struct mg_context *ctx)
virtual void Print(Option_t *option="") const
Default print for collections, calls Print(option, 1).
virtual void AddAll(const TCollection *col)
Add all objects from collection col to this collection.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
Int_t ChecksumDataSet(const char *path, const char *md5path, TString &checksum)
Calculate the checksum of the indicated dataset at 'path' and save it to the appropriate file 'md5pat...
void ParseInitOpts(const char *opts)
Parse the input string and set the init bits accordingly Format is dir:<datasetdir> [mss:<mss-url>] [...
Int_t WriteDataSet(const char *group, const char *user, const char *dsName, TFileCollection *dataset, UInt_t option=0, TMD5 *checksum=0)
Writes indicated dataset.
Int_t NotifyUpdate(const char *group, const char *user, const char *dspath, Long_t mtime, const char *checksum=0)
Save into the <datasetdir>/kDataSet_DataSetList file the name of the updated or created or modified d...
Int_t CreateLsFile(const char *group, const char *user, Long_t &mtime, TString &checksum)
Create or recreate the dataset lists for 'uri'.
TFileCollection * GetDataSet(const char *uri, const char *srv=0)
Utility function used in various methods for user dataset upload.
Bool_t ExistsDataSet(const char *group, const char *user, const char *dsName)
Checks if the indicated dataset exits.
Int_t RegisterDataSet(const char *uri, TFileCollection *dataSet, const char *opt)
Register a dataset, perfoming quota checkings and verification, if required.
const char * GetDataSetPath(const char *group, const char *user, const char *dsName)
void UpdateUsedSpace()
updates the used space maps
Bool_t BrowseDataSets(const char *group, const char *user, const char *dsName, UInt_t option, TObject *target)
Adds the dataset in the folder of group, user to the list in target.
void InitLocalCache()
Init the local cache if required.
Bool_t RemoveDataSet(const char *group, const char *user, const char *dsName)
Removes the indicated dataset.
Int_t ShowCache(const char *uri=0)
Show cached information matching uri.
Int_t CheckLocalCache(const char *group, const char *user, const char *dsName="ls", UInt_t option=0)
Check if the local cache information for group, user, dsName is up-to-date If not,...
TMap * GetDataSets(const char *uri, UInt_t option=TDataSetManager::kExport)
Returns all datasets for the <group> and <user> specified by <uri>.
Int_t ScanDataSet(const char *group, const char *user, const char *dsName, UInt_t option=kReopen|kDebug)
See documentation of ScanDataSet(TFileCollection *dataset, UInt_t option)
Int_t FillLsDataSet(const char *group, const char *user, const char *dsName, TList *out, UInt_t option)
Check for the 'ls.txt' for 'group' and 'user' and fill the path for the ls file in 'out'.
Int_t ClearCache(const char *uri=0)
Clear cached information matching uri.
Long_t GetModTime(const char *uri)
Gets last dataset modification time.
void Init()
Do the real inititialization.
static TString fgCommonDataSetTag
virtual Long64_t GetGroupUsed(const char *group)
Returns the used space of that group.
Int_t ScanDataSet(const char *uri, const char *opt)
Scans the dataset indicated by 'uri' following the 'opts' directives.
void GetQuota(const char *group, const char *user, const char *dsName, TFileCollection *dataset)
Gets quota information from this dataset.
virtual void ShowDataSets(const char *uri="*", const char *opt="")
Prints formatted information about the dataset 'uri'.
Int_t GetNDisapparedFiles() const
Bool_t ParseUri(const char *uri, TString *dsGroup=0, TString *dsUser=0, TString *dsName=0, TString *dsTree=0, Bool_t onlyCurrent=kFALSE, Bool_t wildcards=kFALSE)
Parses a (relative) URI that describes a DataSet on the cluster.
virtual Long64_t GetGroupQuota(const char *group)
returns the quota a group is allowed to have
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
const char * AsSQLString() const
Return the date & time in SQL compatible string format, like: 1997-01-15 20:16:28.
UInt_t Convert(Bool_t toGMT=kFALSE) const
Convert fDatime from TDatime format to the standard time_t format.
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Class that contains a list of TFileInfo's and accumulated meta data information about its entries.
Int_t Update(Long64_t avgsize=-1)
Update accumulated information about the elements of the collection (e.g.
void ResetBitAll(UInt_t f)
Reset the bit for all TFileInfos.
void SetDefaultTreeName(const char *treeName)
void Print(Option_t *option="") const
Prints the contents of the TFileCollection.
void RemoveMetaData(const char *meta=0)
Removes the indicated meta data object in all TFileInfos and this object If no name is given all meta...
TObjString * ExportInfo(const char *name=0, Int_t popt=0)
Export the relevant info as a string; use 'name' as collection name, if defined, else use GetName().
Long64_t GetTotalSize() const
void SetList(THashList *list)
Int_t Add(TFileInfo *info)
Add TFileInfo to the collection.
Class describing a generic file including meta information.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
static EFileType GetType(const char *name, Option_t *option="", TString *prefix=0)
Resolve the file type as a function of the protocol field in 'name'.
virtual Bool_t Cp(const char *dst, Bool_t progressbar=kTRUE, UInt_t buffersize=1000000)
Allows to copy this file to the dst URL.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseGeneralPurpose, Int_t netopt=0)
Create / open a file.
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
void Clear(Option_t *option="")
Remove all objects from the list.
virtual void Add(TObject *obj)
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
A scoped lock based on files.
This code implements the MD5 message-digest algorithm.
const char * AsString() const
Return message digest as string.
static TMD5 * FileChecksum(const char *file)
Returns checksum of specified file.
static TMD5 * ReadChecksum(const char *file)
Returns checksum stored in ASCII in specified file.
static Int_t WriteChecksum(const char *file, const TMD5 *md5)
Writes checksum in ASCII format to specified file.
Class supporting a collection of lines with C++ code.
virtual TObjString * AddLine(const char *text)
Add line with text in the list of lines of this macro.
virtual Int_t ReadFile(const char *filename)
Read lines in filename in this macro.
void SaveSource(FILE *fp)
Save macro source in file pointer fp.
TList * GetListOfLines() const
virtual TObjString * GetLineWith(const char *text) const
Search the first line containing text.
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
void DeleteAll()
Remove all (key,value) pairs from the map AND delete the keys AND values when they are allocated on t...
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection).
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
TObject * Remove(TObject *key)
Remove the (key,value) pair with key from the map.
virtual void SetName(const char *name)
Set the name of the TNamed.
Collectable string class.
const char * GetName() const
Returns name of object.
const TString & GetString() const
void SetString(const char *s)
Mother of all ROOT objects.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
@ kOverwrite
overwrite existing object with same name
@ kSingleKey
write collection with single key
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
@ kInvalidObject
if object ctor succeeded but object should not be used
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Regular expression class.
void ToLower()
Change string to lower-case.
TString & Insert(Ssiz_t pos, const char *s)
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
Ssiz_t Last(char c) const
Find last occurrence of a character c.
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
static Int_t GetErrno()
Static function returning system error number.
virtual int Chmod(const char *file, UInt_t mode)
Set the file permission bits. Returns -1 in case or error, 0 otherwise.
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
virtual void FreeDirectory(void *dirp)
Free a directory.
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
virtual const char * Getenv(const char *env)
Get environment variable.
virtual void ShowOutput(RedirectHandle_t *h)
Display the content associated with the redirection described by the opaque handle 'h'.
virtual int mkdir(const char *name, Bool_t recursive=kFALSE)
Make a file system directory.
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.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
virtual int Rename(const char *from, const char *to)
Rename a file.
virtual int Utime(const char *file, Long_t modtime, Long_t actime)
Set the a files modification and access times.
virtual int Unlink(const char *name)
Unlink, i.e.
virtual Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=0)
Redirect standard output (stdout, stderr) to the specified file.
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
Bool_t SetUri(const TString &uri)
Parse URI and set the member variables accordingly, returns kTRUE if URI validates,...
This class represents a WWW compatible URL.
const char * GetFile() const
const char * GetProtocol() const
RooCmdArg Index(RooCategory &icat)
static constexpr double s
static void output(int code)