47 struct LsTreeEntry_t {
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";
172 const Int_t blen = 8192;
176 Long64_t len = (rest > blen - 1) ? blen - 1 : rest;
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)
389 if ((lsrc =
CreateLsFile(group, user, lsmtime, lschecksum)) < 0) {
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)",
493 uri.
Form(
"/%s/%s", group, user);
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",
628 datasetName.
Data(), user, group);
632 Error(
"GetDataSets",
"dataset %s (user %s, group %s) could not be opened",
633 datasetName.
Data(), user, group);
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);
688 outlist->
Add(fileList->ExportInfo(dsNameFormatted));
695 }
else if (listing) {
703 if (fillmap && datasetMap)
704 datasetMap->Add(
new TObjString(datasetName), fileList);
743 const char *dsName,
UInt_t option)
757 if (group && (strcmp(group,
"*") == 0 || !group[0]))
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;
836 if (!(os->GetString().Contains(
"/ls")))
continue;
838 if (!(os->GetString().Tokenize(dsn, from,
" ")))
continue;
839 if (!(os->GetString().Tokenize(dsn, from,
" ")))
continue;
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());
989 if (o->GetString().Index(reds) !=
kNPOS) {
990 out->
Add(o->Clone());
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());
1501 if (
NotifyUpdate(group, user, dsName, mtime, md5sum) != 0)
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)",
1564 if (
NotifyUpdate(group, user, dsName, 0,
"removed") != 0)
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;
1761 if (dsn.Contains(
"/")) dsn.
Remove(0, dsn.Last(
'/') + 1);
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");
1818 if ((option & kLocateOnly)) sopt = 1;
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;
1884 fc =
GetDataSet(dsGroup, dsUser, dsName, opt);
1887 if (!fcs)
return fc;
1903 if (fc && !ss.
IsNull()) {
1908 while (ss.
Tokenize(s, from,
",")) {
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))
1976 if (!
ParseUri(uri, &group, &user, &name)) {
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
TList * GetListOfLines() const
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
TFileCollection * GetFilesOnServer(const char *server)
Return the subset of files served by 'server'.
static TMD5 * FileChecksum(const char *file)
Returns checksum of specified file.
Int_t RegisterDataSet(const char *uri, TFileCollection *dataSet, const char *opt)
Register a dataset, perfoming quota checkings and verification, if required.
Collectable string class.
Long64_t GetTotalSize() const
This class represents a WWW compatible URL.
TString & ReplaceAll(const TString &s1, const TString &s2)
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 Bool_t ReadBuffer(char *buf, Int_t len)
Read a buffer from the file.
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
virtual void AddAll(const TCollection *col)
Add all objects from collection col to this collection.
Regular expression class.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
overwrite existing object with same name
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection)...
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Class supporting a collection of lines with C++ code.
const char * AsString() const
Return message digest as string.
void ToLower()
Change string to lower-case.
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
Long_t GetModTime(const char *uri)
Gets last dataset modification time.
const char *const kDataSet_LocalCache
virtual void ShowDataSets(const char *uri="*", const char *opt="")
Prints formatted information about the dataset 'uri'.
void UpdateUsedSpace()
updates the used space maps
TString & Insert(Ssiz_t pos, const char *s)
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...
const char *const kDataSet_DataSetList
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.
virtual TObject * FindObject(const char *name) const
Delete a TObjLink object.
static Int_t GetErrno()
Static function returning system error number.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
virtual void Sort(Bool_t order=kSortAscending)
Sort linked list.
virtual Bool_t Cp(const char *dst, Bool_t progressbar=kTRUE, UInt_t buffersize=1000000)
Allows to copy this file to the dst URL.
virtual int Rename(const char *from, const char *to)
Rename a file.
const char * GetFile() const
static struct mg_connection * fc(struct mg_context *ctx)
Int_t Update(Long64_t avgsize=-1)
Update accumulated information about the elements of the collection (e.g.
Bool_t SetUri(const TString &uri)
Parse URI and set the member variables accordingly, returns kTRUE if URI validates, and kFALSE otherwise: URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] hier-part = "//" authority path-abempty / path-absolute / path-rootless / path-empty.
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
Int_t ShowCache(const char *uri=0)
Show cached information matching uri.
virtual TObjString * GetLineWith(const char *text) const
Search the first line containing text.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
Int_t GetNDisapparedFiles() const
This code implements the MD5 message-digest algorithm.
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'.
void DeleteAll()
Remove all (key,value) pairs from the map AND delete the keys AND values when they are allocated on t...
void ParseInitOpts(const char *opts)
Parse the input string and set the init bits accordingly Format is dir:<datasetdir> [mss:<mss-url>] [...
virtual Long64_t GetGroupQuota(const char *group)
returns the quota a group is allowed to have
virtual const char * Getenv(const char *env)
Get environment variable.
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...
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...
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
void Init()
Do the real inititialization.
R__ALWAYS_INLINE Bool_t IsZombie() const
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'...
Bool_t RemoveDataSet(const char *group, const char *user, const char *dsName)
Removes the indicated dataset.
const char * GetName() const
Returns name of object.
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.
const TString & GetString() const
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)
void Clear(Option_t *option="")
Remove all objects from the list.
Int_t CreateLsFile(const char *group, const char *user, Long_t &mtime, TString &checksum)
Create or recreate the dataset lists for 'uri'.
TMap * GetDataSets(const char *uri, UInt_t option=TDataSetManager::kExport)
Returns all datasets for the <group> and <user> specified by <uri>.
R__EXTERN TSystem * gSystem
static Int_t WriteChecksum(const char *file, const TMD5 *md5)
Writes checksum in ASCII format to specified file.
write collection with single key
if object ctor succeeded but object should not be used
TObject * Remove(TObject *key)
Remove the (key,value) pair with key from the map.
Int_t Add(TFileInfo *info)
Add TFileInfo to the collection.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
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.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Int_t WriteDataSet(const char *group, const char *user, const char *dsName, TFileCollection *dataset, UInt_t option=0, TMD5 *checksum=0)
Writes indicated dataset.
const char * AsSQLString() const
Return the date & time in SQL compatible string format, like: 1997-01-15 20:16:28.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
const char * GetDataSetPath(const char *group, const char *user, const char *dsName)
Int_t ScanDataSet(const char *uri, const char *opt)
Scans the dataset indicated by 'uri' following the 'opts' directives.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
char * Form(const char *fmt,...)
void SaveSource(FILE *fp)
Save macro source in file pointer fp.
virtual Int_t ReadFile(const char *filename)
Read lines in filename in this macro.
virtual int Utime(const char *file, Long_t modtime, Long_t actime)
Set the a files modification and access times.
virtual void FreeDirectory(void *dirp)
Free a directory.
void GetQuota(const char *group, const char *user, const char *dsName, TFileCollection *dataset)
Gets quota information from this dataset.
virtual Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=0)
Redirect standard output (stdout, stderr) to the specified file.
TString & Remove(Ssiz_t pos)
RooCmdArg Index(RooCategory &icat)
virtual int Chmod(const char *file, UInt_t mode)
Set the file permission bits. Returns -1 in case or error, 0 otherwise.
A scoped lock based on files.
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
void SetDefaultTreeName(const char *treeName)
static TString fgCommonDataSetTag
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
virtual Long64_t GetSize() const
Returns the current file size.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
static constexpr double s
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
UInt_t Convert(Bool_t toGMT=kFALSE) const
Convert fDatime from TDatime format to the standard time_t format.
Mother of all ROOT objects.
Bool_t ExistsDataSet(const char *group, const char *user, const char *dsName)
Checks if the indicated dataset exits.
Bool_t R_ISDIR(Int_t mode)
void InitLocalCache()
Init the local cache if required.
virtual void Add(TObject *obj)
Class that contains a list of TFileInfo's and accumulated meta data information about its entries...
virtual void ShowOutput(RedirectHandle_t *h)
Display the content associated with the redirection described by the opaque handle 'h'...
TFileCollection * GetDataSet(const char *uri, const char *srv=0)
Utility function used in various methods for user dataset upload.
void ResetBitAll(UInt_t f)
Reset the bit for all TFileInfos.
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
Class describing a generic file including meta information.
static TMD5 * ReadChecksum(const char *file)
Returns checksum stored in ASCII in specified file.
void SetString(const char *s)
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
virtual Long64_t GetGroupUsed(const char *group)
Returns the used space of that group.
Int_t ClearCache(const char *uri=0)
Clear cached information matching uri.
const char *const kDataSet_LockLocation
virtual TObjString * AddLine(const char *text)
Add line with text in the list of lines of this macro.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
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, make the relevant updates Return 0 if OK, 1 if the dataset does not exists anymore, -1 on failure.
void SetList(THashList *list)
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
virtual void Close(Option_t *option="")
Close a file.
const char * Data() const