79#define _XOPEN_SOURCE 600
90# include <sys/types.h>
96#include "RConfigure.h"
128#include "compiledata.h"
164static struct AddPseudoGlobals {
217 Info(
"TFile",
"default ctor");
326 ::Fatal(
"TFile::TFile",
"ROOT system not initialized");
421 if (!create && !recreate && !
update && !read) {
428 if (!fname1 || !fname1[0]) {
429 Error(
"TFile",
"file name is not specified");
434 if (!strcmp(fname1,
"/dev/null") &&
452 Error(
"TFile",
"error expanding path %s", fname1);
459 SysError(
"TFile",
"could not delete %s (errno: %d)",
469 Error(
"TFile",
"file %s already exists", fname);
478 Error(
"TFile",
"no write permission, could not open file %s", fname);
484 Error(
"TFile",
"file %s does not exist", fname);
488 Error(
"TFile",
"no read permission, could not open file %s", fname);
496 fD =
SysOpen(fname, O_RDWR | O_CREAT, 0644);
501 SysError(
"TFile",
"file %s can not be opened", fname);
512 SysError(
"TFile",
"file %s can not be opened for reading", fname);
526 gROOT->GetListOfClosedObjects()->Add(
this);
537 MayNotUse(
"TFile::TFile(const TFile &)");
570 gROOT->GetListOfClosedObjects()->Remove(
this);
607 Error(
"Init",
"archive %s can only be opened in read mode",
GetName());
626 Error(
"Init",
"member %s not found in archive %s",
664 char *header =
new char[
kBEGIN+200];
669 Error(
"Init",
"%s failed to read the file type data.",
676 if (strncmp(header,
"root", 4)) {
682 char *buffer = header + 4;
685 frombuf(buffer, &headerLength);
688 Int_t send,sfree,sinfo;
709 if (fBEGIN < 0 || fBEGIN >
fEND) {
711 Error(
"Init",
"file %s has an incorrect header length (%lld) or incorrect end of file length (%lld)",
722 Warning(
"Init",
"file %s probably not closed, cannot read free segments",
GetName());
727 char *buffer_keyloc = 0;
732 Error(
"Init",
"file %s has an incorrect header length (%lld) or incorrect end of file length (%lld)",
738 header =
new char[nbytes];
743 Error(
"Init",
"%s failed to read the file header information at %lld (size=%d)",
749 buffer_keyloc = header;
752 buffer_keyloc = header+
fBEGIN;
755 frombuf(buffer,&version); versiondir = version%1000;
760 if (version > 1000) {
765 Int_t sdir,sparent,skeys;
773 buffer_keyloc +=
sizeof(
Int_t);
775 frombuf(buffer_keyloc, &keyversion);
777 if (keyversion > 1000) {
788 if (fNbytesName < 10 || fNbytesName > 10000) {
789 Error(
"Init",
"cannot read directory info of file %s",
GetName());
795 if ((size =
GetSize()) == -1) {
825 Error(
"Init",
"file %s is truncated at %lld bytes: should be %lld, "
828 Error(
"Init",
"file %s is truncated at %lld bytes: should be %lld",
834 Warning(
"Init",
"file %s probably not closed, "
835 "trying to recover",
GetName());
843 Warning(
"Init",
"successfully recovered %d keys", nrecov);
845 Warning(
"Init",
"no keys recovered, file has been made a Zombie");
853 gROOT->GetListOfFiles()->Add(
this);
859 Int_t lenIndex =
gROOT->GetListOfStreamerInfo()->GetSize()+1;
860 if (lenIndex < 5000) lenIndex = 5000;
867 gROOT->GetListOfFiles()->Remove(
this);
873 Warning(
"Init",
"no StreamerInfo found in %s therefore preventing schema evolution when reading this file."
874 " The file was produced with version %d.%02d/%02d of ROOT.",
885 while ((key = (
TKey*)next())) {
895 gROOT->GetListOfClosedObjects()->Add(
this);
943 while ((key = iter()) != 0) {
1001 gROOT->GetListOfFiles()->Remove(
this);
1002 gROOT->GetListOfBrowsers()->RecursiveRemove(
this);
1003 gROOT->GetListOfClosedObjects()->Add(
this);
1014 return new TKey(obj,
name, bufsize, mother);
1022 return new TKey(obj, cl,
name, bufsize, mother);
1034 static TFile *currentFile = 0;
1066 Info(
"Delete",
"deleting name = %s", namecycle);
1087 if ((
h =
gROOT->GetPluginManager()->FindHandler(
"TFileDrawMap"))) {
1088 if (
h->LoadPlugin() == -1)
1090 h->ExecPlugin(3,
this, keys, option);
1128 Version_t version = TFile::Class_Version();
1129 tobuf(buffer, version);
1145 if (result >= (
double)std::numeric_limits<Int_t>::max()) {
1146 return std::numeric_limits<Int_t>::max() -1;
1148 return (
Int_t)result;
1162 Int_t nbytes, objlen, nwh = 64;
1163 char *header =
new char[
fBEGIN];
1169 while (idcur <
fEND-100) {
1184 if (nbytes == 0)
break;
1190 if (!objlen) objlen = nbytes-keylen;
1192 uncomp += keylen + objlen;
1263 Int_t nread = maxbytes;
1266 Warning(
"GetRecordHeader",
"%s: parameter maxbytes = %d must be >= 4",
1272 Warning(
"GetRecordHeader",
"%s: failed to read header data (maxbytes = %d)",
1283 if (nb < 0)
return nread;
1285 const Int_t headerSize = 16;
1286 if (nread < headerSize)
return nread;
1291 if (!olen) olen = nbytes-klen;
1309 if (
const_cast<TFile*
>(
this)->
SysStat(
fD, &
id, &size, &flags, &modtime)) {
1310 Error(
"GetSize",
"cannot stat the file %s",
GetName());
1339 auto key = std::make_unique<TKey>(
this);
1341 auto buf = buffer.data();
1345 Warning(
"GetRecordHeader",
"%s: failed to read the StreamerInfo data from disk.",
1347 return {
nullptr, 1, hash};
1351 if (lookupSICache) {
1354 if (
gDebug > 0)
Info(
"GetStreamerInfo",
"The streamer info record for file %s has already been treated, skipping it.",
GetName());
1355 return {
nullptr, 0, hash};
1359 (
void) lookupSICache;
1361 key->ReadKeyBuffer(buf);
1362 list =
dynamic_cast<TList*
>(key->ReadObjWithBuffer(buffer.data()));
1365 list = (
TList*)
Get(
"StreamerInfo");
1369 Info(
"GetStreamerInfoList",
"cannot find the StreamerInfo record in file %s",
1371 return {
nullptr, 1, hash};
1374 return {list, 0, hash};
1441 if(!newfree)
return;
1445 if (nbytesl > 2000000000) nbytesl = 2000000000;
1448 char * buffer =
new char[nb];
1449 char * psave = buffer;
1450 tobuf(buffer, nbytes);
1509 bool forComp = options.
Contains(
"forcomp");
1513 Int_t nbytes,date,time,objlen,nwheader;
1522 Int_t nread = nwheader;
1525 char classname[512];
1529 while (idcur <
fEND) {
1531 if (idcur+nread >=
fEND) nread =
fEND-idcur-1;
1534 Warning(
"Map",
"%s: failed to read the key data from disk at %lld.",
1542 Printf(
"Address = %lld\tNbytes = %d\t=====E R R O R=======", idcur, nbytes);
1547 Printf(
"Address = %lld\tNbytes = %d\t=====G A P===========", idcur, nbytes);
1558 if (versionkey > 1000) {
1567 for (
int i = 0;i < nwhc; i++)
frombuf(buffer, &classname[i]);
1568 classname[(int)nwhc] =
'\0';
1569 if (idcur ==
fSeekFree) strlcpy(classname,
"FreeSegments",512);
1570 if (idcur ==
fSeekInfo) strlcpy(classname,
"StreamerInfo",512);
1571 if (idcur ==
fSeekKeys) strlcpy(classname,
"KeysList",512);
1574 if (objlen != nbytes - keylen) {
1576 Printf(
"%d/%06d At:%-*lld N=%-8d %-14s CX = %5.2f", date, time, nDigits + 1, idcur, nbytes, classname,
1579 Printf(
"%d/%06d At:%-*lld N=%-8d %-14s", date, time, nDigits + 1, idcur, nbytes, classname);
1583 if (objlen != nbytes - keylen) {
1585 Printf(
"At:%-*lld N=%-8d K=%-3d O=%-8d %-14s CX = %5.2f", nDigits+1, idcur, nbytes, keylen, objlen, classname, cx);
1587 Printf(
"At:%-*lld N=%-8d K=%-3d O=%-8d %-14s CX = 1", nDigits+1, idcur, nbytes, keylen, objlen, classname);
1593 Printf(
"%d/%06d At:%-*lld N=%-8d %-14s",date,time, nDigits+1, idcur,1,
"END");
1595 Printf(
"At:%-*lld N=%-8d K= O= %-14s", nDigits+1, idcur,1,
"END");
1650 Error(
"ReadBuffer",
"error reading all requested bytes from file %s, got %ld of %d",
1697 Error(
"ReadBuffer",
"error reading all requested bytes from file %s, got %ld of %d",
1728 for (
Int_t j = 0; j < nbuf; j++) {
1745 cur = pos[i]+len[i];
1748 if (bigRead || (i>=nbuf)) {
1762 Long64_t nahead = pos[i-1]+len[i-1]-curbegin;
1767 for (
Int_t j=0;j<
n;j++) {
1768 memcpy(&buf[k],&buf2[pos[i-
n+j]-curbegin],len[i-
n+j]);
1778 curbegin = i < nbuf ? pos[i] : 0;
1781 if (buf2)
delete [] buf2;
1831 if (fNbytesFree < 0 || fNbytesFree >
fEND) {
1867 snprintf(pidname,32,
"ProcessID%d",pidf);
1870 printf(
"ReadProcessID, name=%s, file=%s, pid=%lx\n",pidname,
GetName(),(
Long_t)pid);
1879 TIter next(pidslist);
1952 Int_t nbytes,date,time,objlen,nwheader;
1955 char *buffer, *bufread;
1960 if ((size =
GetSize()) == -1) {
1961 Error(
"Recover",
"cannot stat the file %s",
GetName());
1972 Int_t nread = nwheader;
1974 while (idcur <
fEND) {
1976 if (idcur+nread >=
fEND) nread =
fEND-idcur-1;
1979 Error(
"Recover",
"%s: failed to read the key data from disk at %lld.",
1987 Error(
"Recover",
"Address = %lld\tNbytes = %d\t=====E R R O R=======", idcur, nbytes);
2002 if (versionkey > 1000) {
2011 char *classname = 0;
2012 if (nwhc <= 0 || nwhc > 100)
break;
2013 classname =
new char[nwhc+1];
2014 int i, nwhci = nwhc;
2015 for (i = 0;i < nwhc; i++)
frombuf(buffer, &classname[i]);
2016 classname[nwhci] =
'\0';
2020 && strcmp(classname,
"TBasket")) {
2021 key =
new TKey(
this);
2023 if (!strcmp(key->
GetName(),
"StreamerInfo")) {
2034 delete [] classname;
2039 if (max_file_size <
fEND) max_file_size =
fEND+1000000000;
2046 if (nrecov)
Write();
2069 if (opt !=
"READ" && opt !=
"UPDATE") {
2070 Error(
"ReOpen",
"mode must be either READ or UPDATE, not %s", opt.
Data());
2077 if (opt ==
"READ") {
2115 SysError(
"ReOpen",
"file %s can not be opened in read mode",
GetName());
2137 SysError(
"ReOpen",
"file %s can not be opened in update mode",
GetName());
2146 Warning(
"ReOpen",
"file %s probably not closed, cannot read free segments",
GetName());
2167 Error(
"SetOffset",
"seeking from end in archive is not (yet) supported");
2191 Error(
"Seek",
"seeking from end in archive is not (yet) supported");
2195 if ((retpos =
SysSeek(
fD, offset, whence)) < 0)
2196 SysError(
"Seek",
"cannot seek to position %lld in file %s, retpos=%lld",
2223 if (level < 0) level = 0;
2224 if (level > 99) level = 99;
2279 if (cache) cache->
SetFile(
this, action);
2309 if (
b.IsReading()) {
2312 b.WriteVersion(TFile::IsA());
2370 Error(
"Write const",
"A const TFile object should not be saved. We try to proceed anyway.");
2371 return const_cast<TFile*
>(
this)->
Write(
n, opt, bufsize);
2402 Error(
"WriteBuffer",
"error writing all requested bytes to file %s, wrote %ld of %d",
2429 Error(
"WriteBuffer",
"error writing to cache");
2454 auto createKey = [
this]() {
2458 while ((afree = (
TFree*) next())) {
2459 nbytes += afree->
Sizeof();
2461 if (!nbytes)
return (
TKey*)
nullptr;
2467 return (
TKey*)
nullptr;
2472 TKey *key = createKey();
2489 char *start = buffer;
2493 while ((afree = (
TFree*) next())) {
2498 auto actualBytes = buffer-start;
2499 if ( actualBytes != nbytes ) {
2500 if (actualBytes < nbytes) {
2503 memset(buffer,0,nbytes-actualBytes);
2505 Error(
"WriteFree",
"The free block list TKey wrote more data than expected (%d vs %ld). Most likely there has been an out-of-bound write.",nbytes,(
long int)actualBytes);
2522 const char *root =
"root";
2523 char *psave =
new char[
fBEGIN];
2524 char *buffer = psave;
2526 memcpy(buffer, root, 4); buffer += 4;
2529 tobuf(buffer, version);
2531 if (version < 1000000) {
2535 tobuf(buffer, nfree);
2545 tobuf(buffer, nfree);
2553 Int_t nbytes = buffer - psave;
2644 path +=
"/PROOF-INF";
2646 const char *afile = 0;
2649 if (strcmp(afile,
".") == 0)
continue;
2650 if (strcmp(afile,
"..") == 0)
continue;
2651 filepath.
Form(
"%s/%s", path.
Data(), afile);
2653 Warning(
"MakeProject",
"1: problems unlinking '%s' ('%s', '%s')", filepath.
Data(), path.
Data(), afile);
2660 if (strcmp(afile,
".") == 0)
continue;
2661 if (strcmp(afile,
"..") == 0)
continue;
2662 filepath.
Form(
"%s/%s", path.
Data(), afile);
2664 Warning(
"MakeProject",
"2: problems unlinking '%s' ('%s', '%s')", filepath.
Data(), path.
Data(), afile);
2668 Warning(
"MakeProject",
"problems unlinking '%s'", path.
Data());
2672 path.
Form(
"%s/%s/PROOF-INF", pardir.
Data(), parname.
Data());
2674 Error(
"MakeProject",
"problems creating '%s'", path.
Data());
2689 }
else if (opt.
Contains(
"recreate")) {
2693 Error(
"MakeProject",
"cannot create directory '%s'",dirname);
2700 if (afile == 0)
break;
2701 if (strcmp(afile,
".") == 0)
continue;
2702 if (strcmp(afile,
"..") == 0)
continue;
2703 dirpath.
Form(
"%s/%s",dirname,afile);
2711 Error(
"MakeProject",
"cannot create directory %s, already existing",dirname);
2716 Error(
"MakeProject",
"cannot create directory '%s'",dirname);
2729 if (filelist) filelist = (
TList*)filelist->
Clone();
2730 if (filelist == 0) {
2731 Error(
"MakeProject",
"file %s has no StreamerInfo",
GetName());
2735 TString clean_dirname(dirname);
2736 if (makepar) clean_dirname.
Form(
"%s/%s", pardir.
Data(), parname.
Data());
2737 if (clean_dirname[clean_dirname.
Length()-1]==
'/') {
2739 }
else if (clean_dirname[clean_dirname.
Length()-1]==
'\\') {
2741 if (clean_dirname[clean_dirname.
Length()-1]==
'\\') {
2746 if (makepar) subdirname = parname;
2747 if (subdirname ==
"") {
2748 Error(
"MakeProject",
"Directory name must not be empty.");
2753 TString spath; spath.
Form(
"%s/%sProjectSource.cxx",clean_dirname.
Data(),subdirname.
Data());
2754 FILE *sfp = fopen(spath.
Data(),
"w");
2756 Error(
"MakeProject",
"Unable to create the source file %s.",spath.
Data());
2759 fprintf(sfp,
"namespace std {}\nusing namespace std;\n");
2760 fprintf(sfp,
"#include \"%sProjectHeaders.h\"\n\n",subdirname.
Data() );
2761 if (!
genreflex) fprintf(sfp,
"#include \"%sLinkDef.h\"\n\n",subdirname.
Data() );
2762 fprintf(sfp,
"#include \"%sProjectDict.cxx\"\n\n",subdirname.
Data() );
2763 fprintf(sfp,
"struct DeleteObjectFunctor {\n");
2764 fprintf(sfp,
" template <typename T>\n");
2765 fprintf(sfp,
" void operator()(const T *ptr) const {\n");
2766 fprintf(sfp,
" delete ptr;\n");
2767 fprintf(sfp,
" }\n");
2768 fprintf(sfp,
" template <typename T, typename Q>\n");
2769 fprintf(sfp,
" void operator()(const std::pair<T,Q> &) const {\n");
2770 fprintf(sfp,
" // Do nothing\n");
2771 fprintf(sfp,
" }\n");
2772 fprintf(sfp,
" template <typename T, typename Q>\n");
2773 fprintf(sfp,
" void operator()(const std::pair<T,Q*> &ptr) const {\n");
2774 fprintf(sfp,
" delete ptr.second;\n");
2775 fprintf(sfp,
" }\n");
2776 fprintf(sfp,
" template <typename T, typename Q>\n");
2777 fprintf(sfp,
" void operator()(const std::pair<T*,Q> &ptr) const {\n");
2778 fprintf(sfp,
" delete ptr.first;\n");
2779 fprintf(sfp,
" }\n");
2780 fprintf(sfp,
" template <typename T, typename Q>\n");
2781 fprintf(sfp,
" void operator()(const std::pair<T*,Q*> &ptr) const {\n");
2782 fprintf(sfp,
" delete ptr.first;\n");
2783 fprintf(sfp,
" delete ptr.second;\n");
2784 fprintf(sfp,
" }\n");
2785 fprintf(sfp,
"};\n\n");
2792 TIter flnext(filelist);
2799 if (strstr(info->
GetName(),
"@@")) {
2816 for(
auto rule : rules) {
2817 if( rule->IsRenameRule() || rule->IsAliasRule() )
2820 if ( rule->HasTarget( el->
GetName()) && rule->GetAttributes()[0] != 0 ) {
2821 TString attr( rule->GetAttributes() );
2847 TIter nextextra(&extrainfos);
2850 filelist->
Add(info);
2861 TIter subnext(list);
2873 if ( (sublen > len) && subinfo->
GetName()[len+1]==
':'
2876 subClasses.
Add(subinfo);
2881 subClasses.
Clear(
"nodelete");
2883 extrainfos.
Clear(
"nodelete");
2886 path.
Form(
"%s/%sProjectHeaders.h",clean_dirname.
Data(),subdirname.
Data());
2887 FILE *allfp = fopen(path,
"a");
2889 Error(
"MakeProject",
"Cannot open output file:%s\n",path.
Data());
2891 fprintf(allfp,
"#include \"%sProjectInstances.h\"\n", subdirname.
Data());
2895 printf(
"MakeProject has generated %d classes in %s\n",ngener,clean_dirname.
Data());
2898 if (!opt.
Contains(
"+") && !makepar) {
2911 path.
Form(
"%s/makep.cmd",clean_dirname.
Data());
2913 path.
Form(
"%s/MAKEP",clean_dirname.
Data());
2916 fpMAKE = fopen(path,
"wb");
2918 fpMAKE = fopen(path,
"w");
2921 Error(
"MakeProject",
"cannot open file %s", path.
Data());
2931 path.
Form(
"%s/%sProjectInstances.h",clean_dirname.
Data(),subdirname.
Data());
2933 ifp = fopen(path,
"wb");
2935 ifp = fopen(path,
"w");
2938 Error(
"MakeProject",
"cannot open path file %s", path.
Data());
2948 fprintf(fpMAKE,
"genreflex %sProjectHeaders.h -o %sProjectDict.cxx --comments --iocomments %s ",subdirname.
Data(),subdirname.
Data(),
gSystem->
GetIncludePath());
2949 path.
Form(
"%s/%sSelection.xml",clean_dirname.
Data(),subdirname.
Data());
2952 path.
Form(
"%s/%sLinkDef.h",clean_dirname.
Data(),subdirname.
Data());
2955 path.
Form(
"%s/%sLinkDef.h",clean_dirname.
Data(),subdirname.
Data());
2961 FILE *fp = fopen(path,
"wb");
2963 FILE *fp = fopen(path,
"w");
2966 Error(
"MakeProject",
"cannot open path file %s", path.
Data());
2975 fprintf(fp,
"<lcgdict>\n");
2978 fprintf(fp,
"#ifdef __CINT__\n");
2990 if (strncmp(info->
GetName(),
"auto_ptr<", strlen(
"auto_ptr<")) == 0) {
2999 for(
auto rule : rules) {
3002 rule->AsString(strrule,
"x");
3005 selections.
Append(strrule);
3008 rule->AsString(strrule);
3009 if (strncmp(strrule.
Data(),
"type=",5)==0) {
3012 fprintf(fp,
"#pragma %s;\n",strrule.
Data());
3019 std::vector<std::string> inside;
3026 switch ( stlkind ) {
3030 what =
"std::pair<";
3034 if (what[what.
Length()-1]==
'>') {
3040 tmp.
Form(
"<class name=\"%s\" />\n",what.
Data());
3044 tmp.
Form(
"template class %s;\n",what.
Data());
3052 fprintf(fp,
"#pragma link C++ class %s+;\n",what.
Data());
3058 if (strncmp(key->
GetName(),
"pair<",strlen(
"pair<"))==0) {
3060 tmp.
Form(
"<class name=\"%s\" />\n",key->
GetName());
3070 fprintf(fp,
"#pragma link C++ class %s+;\n",key->
GetName());
3081 tmp.
Form(
"<class name=\"%s\" />\n",what.
Data());
3085 if (what[what.
Length()-1] ==
'>') {
3086 tmp.
Form(
"template class %s;\n",what.
Data());
3093 fprintf(fp,
"#pragma link C++ class %s+;\n",what.
Data());
3103 tmp.
Form(
"<class name=\"%s\" />\n",what.
Data());
3107 tmp.
Form(
"template class %s;\n",what.
Data());
3116 fprintf(ifp,
"#ifndef PROJECT_INSTANCES_H\n");
3117 fprintf(ifp,
"#define PROJECT_INSTANCES_H\n");
3118 fprintf(ifp,
"%s",instances.
Data());
3119 fprintf(ifp,
"#endif\n");
3120 fprintf(fp,
"%s",selections.
Data());
3121 fprintf(fp,
"</lcgdict>\n");
3123 fprintf(fp,
"#endif\n");
3137 cmd.
ReplaceAll(
"$ObjectFiles",
object.Data());
3144 TString rootbuild = ROOTBUILD;
3153 fprintf(fpMAKE,
"-s %sSelection.xml \n",subdirname.
Data());
3155 fprintf(fpMAKE,
"%sProjectHeaders.h ",subdirname.
Data());
3156 fprintf(fpMAKE,
"%sLinkDef.h \n",subdirname.
Data());
3159 fprintf(fpMAKE,
"%s\n",cmd.
Data());
3161 printf(
"%s/MAKEP file has been generated\n", clean_dirname.
Data());
3170 Error(
"MakeProject",
"problems creating PAR make file '%s'", filemake.
Data());
3179 Warning(
"MakeProject",
"problems expanding '%s'", mkarchsrc.
Data());
3182 Error(
"MakeProject",
"problems retrieving '%s' to '%s'", mkarchsrc.
Data(), mkarchdst.
Data());
3191 Error(
"MakeProject",
"problems creating BUILD.sh and/or SETUP.C under '%s'", proofinf.
Data());
3204 chmod(cmod.
Data(), 00700);
3206 Printf(
"Files Makefile, Makefile.arch, PROOF-INF/BUILD.sh and"
3207 " PROOF-INF/SETUP.C have been generated under '%s'", clean_dirname.
Data());
3216 Info(
"MakeProject",
"PAR file %s.par generated", clean_dirname.
Data());
3218 Warning(
"MakeProject",
"problems changing directory back to '%s'", curdir.
Data());
3221 Error(
"MakeProject",
"problems changing directory to '%s' - skipping PAR file generation", pardir.
Data());
3224 Warning(
"MakeProject",
"on Windows systems the PAR file cannot be generated out of the package directory!");
3229 if (!makepar && !opt.
Contains(
"nocompilation")) {
3238 chmod(
"makep.cmd",00700);
3243 if (res) printf(
"Shared lib %s has been generated\n",path.
Data());
3248 if (res) printf(
"Shared lib %s has been dynamically linked\n",path.
Data());
3266 if (!filemake || (filemake && strlen(filemake) <= 0)) {
3267 Error(
"MakeProjectParMake",
"path for output file undefined!");
3272 if (!pack || (pack && strlen(pack) <= 0)) {
3273 Error(
"MakeProjectParMake",
"package name undefined!");
3278 FILE *fmk = fopen(filemake,
"wb");
3280 FILE *fmk = fopen(filemake,
"w");
3288 fprintf(fmk,
"# Makefile for the ROOT test programs.\n");
3289 fprintf(fmk,
"# This Makefile shows how to compile and link applications\n");
3290 fprintf(fmk,
"# using the ROOT libraries on all supported platforms.\n");
3291 fprintf(fmk,
"#\n");
3292 fprintf(fmk,
"# Copyright (c) 2000 Rene Brun and Fons Rademakers\n");
3293 fprintf(fmk,
"#\n");
3294 fprintf(fmk,
"# Author: this makefile has been automatically generated via TFile::MakeProject\n");
3296 fprintf(fmk,
"include Makefile.arch\n");
3298 fprintf(fmk,
"#------------------------------------------------------------------------------\n");
3300 fprintf(fmk,
"PACKO = %sProjectSource.$(ObjSuf)\n", pack);
3301 fprintf(fmk,
"PACKS = %sProjectSource.$(SrcSuf) %sProjectDict.$(SrcSuf)\n", pack, pack);
3302 fprintf(fmk,
"PACKSO = lib%s.$(DllSuf)\n", pack);
3304 fprintf(fmk,
"ifeq ($(PLATFORM),win32)\n");
3305 fprintf(fmk,
"PACKLIB = lib%s.lib\n", pack);
3306 fprintf(fmk,
"else\n");
3307 fprintf(fmk,
"PACKLIB = $(PACKSO)\n");
3308 fprintf(fmk,
"endif\n");
3310 fprintf(fmk,
"OBJS = $(PACKO)\n");
3312 fprintf(fmk,
"PROGRAMS =\n");
3314 fprintf(fmk,
"#------------------------------------------------------------------------------\n");
3316 fprintf(fmk,
".SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf)\n");
3318 fprintf(fmk,
"all: $(PACKLIB)\n");
3320 fprintf(fmk,
"$(PACKSO): $(PACKO)\n");
3321 fprintf(fmk,
"ifeq ($(ARCH),aix)\n");
3322 fprintf(fmk,
"\t\t/usr/ibmcxx/bin/makeC++SharedLib $(OutPutOpt) $@ $(LIBS) -p 0 $^\n");
3323 fprintf(fmk,
"else\n");
3324 fprintf(fmk,
"ifeq ($(ARCH),aix5)\n");
3325 fprintf(fmk,
"\t\t/usr/vacpp/bin/makeC++SharedLib $(OutPutOpt) $@ $(LIBS) -p 0 $^\n");
3326 fprintf(fmk,
"else\n");
3327 fprintf(fmk,
"ifeq ($(PLATFORM),macosx)\n");
3328 fprintf(fmk,
"# We need to make both the .dylib and the .so\n");
3329 fprintf(fmk,
"\t\t$(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@ $(LIBS)\n");
3330 fprintf(fmk,
"ifneq ($(subst $(MACOSX_MINOR),,1234),1234)\n");
3331 fprintf(fmk,
"ifeq ($(MACOSX_MINOR),4)\n");
3332 fprintf(fmk,
"\t\tln -sf $@ $(subst .$(DllSuf),.so,$@)\n");
3333 fprintf(fmk,
"else\n");
3334 fprintf(fmk,
"\t\t$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ \\\n");
3335 fprintf(fmk,
"\t\t $(OutPutOpt) $(subst .$(DllSuf),.so,$@)\n");
3336 fprintf(fmk,
"endif\n");
3337 fprintf(fmk,
"endif\n");
3338 fprintf(fmk,
"else\n");
3339 fprintf(fmk,
"ifeq ($(PLATFORM),win32)\n");
3340 fprintf(fmk,
"\t\tbindexplib $* $^ > $*.def\n");
3341 fprintf(fmk,
"\t\tlib -nologo -MACHINE:IX86 $^ -def:$*.def \\\n");
3342 fprintf(fmk,
"\t\t $(OutPutOpt)$(PACKLIB)\n");
3343 fprintf(fmk,
"\t\t$(LD) $(SOFLAGS) $(LDFLAGS) $^ $*.exp $(LIBS) \\\n");
3344 fprintf(fmk,
"\t\t $(OutPutOpt)$@\n");
3345 fprintf(fmk,
"else\n");
3346 fprintf(fmk,
"\t\t$(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(LIBS) $(EXPLLINKLIBS)\n");
3347 fprintf(fmk,
"endif\n");
3348 fprintf(fmk,
"endif\n");
3349 fprintf(fmk,
"endif\n");
3350 fprintf(fmk,
"endif\n");
3351 fprintf(fmk,
"\t\t@echo \"$@ done\"\n");
3353 fprintf(fmk,
"clean:\n");
3354 fprintf(fmk,
"\t\t@rm -f $(OBJS) core\n");
3356 fprintf(fmk,
"distclean: clean\n");
3357 fprintf(fmk,
"\t\t@rm -f $(PROGRAMS) $(PACKSO) $(PACKLIB) *Dict.* *.def *.exp \\\n");
3358 fprintf(fmk,
"\t\t *.so *.lib *.dll *.d *.log .def so_locations\n");
3359 fprintf(fmk,
"\t\t@rm -rf cxx_repository\n");
3361 fprintf(fmk,
"# Dependencies\n");
3363 fprintf(fmk,
"%sProjectSource.$(ObjSuf): %sProjectHeaders.h %sLinkDef.h %sProjectDict.$(SrcSuf)\n", pack, pack, pack, pack);
3365 fprintf(fmk,
"%sProjectDict.$(SrcSuf): %sProjectHeaders.h %sLinkDef.h\n", pack, pack, pack);
3366 fprintf(fmk,
"\t\t@echo \"Generating dictionary $@...\"\n");
3367 fprintf(fmk,
"\t\t@rootcint -f $@ -c $^\n");
3369 fprintf(fmk,
".$(SrcSuf).$(ObjSuf):\n");
3370 fprintf(fmk,
"\t\t$(CXX) $(CXXFLAGS) -c $<\n");
3388 if (!proofinf || (proofinf && strlen(proofinf) <= 0)) {
3389 Error(
"MakeProjectParProofInf",
"directory path undefined!");
3397 Error(
"MakeProjectParProofInf",
"path '%s' %s", proofinf,
3398 ((rcst == 0) ?
"is not a directory" :
"does not exist"));
3403 if (!pack || (pack && strlen(pack) <= 0)) {
3404 Error(
"MakeProjectParProofInf",
"package name undefined!");
3411 path.
Form(
"%s/BUILD.sh", proofinf);
3413 FILE *
f = fopen(path.
Data(),
"wb");
3415 FILE *
f = fopen(path.
Data(),
"w");
3418 Error(
"MakeProjectParProofInf",
"cannot create file '%s' (errno: %d)",
3423 fprintf(
f,
"#! /bin/sh\n");
3424 fprintf(
f,
"# Build libEvent library.\n");
3427 fprintf(
f,
"# The environment variables ROOTPROOFLITE and ROOTPROOFCLIENT can be used to\n");
3428 fprintf(
f,
"# adapt the script to the calling environment\n");
3430 fprintf(
f,
"# if test ! \"x$ROOTPROOFLITE\" = \"x\"; then\n");
3431 fprintf(
f,
"# echo \"event-BUILD: PROOF-Lite node (session has $ROOTPROOFLITE workers)\"\n");
3432 fprintf(
f,
"# elif test ! \"x$ROOTPROOFCLIENT\" = \"x\"; then\n");
3433 fprintf(
f,
"# echo \"event-BUILD: PROOF client\"\n");
3434 fprintf(
f,
"# else\n");
3435 fprintf(
f,
"# echo \"event-BUILD: standard PROOF node\"\n");
3436 fprintf(
f,
"# fi\n");
3438 fprintf(
f,
"if [ \"\" = \"clean\" ]; then\n");
3439 fprintf(
f,
" make distclean\n");
3440 fprintf(
f,
" exit 0\n");
3443 fprintf(
f,
"make\n");
3444 fprintf(
f,
"rc=$?\n");
3445 fprintf(
f,
"echo \"rc=$?\"\n");
3446 fprintf(
f,
"if [ $? != \"0\" ] ; then\n");
3447 fprintf(
f,
" exit 1\n");
3449 fprintf(
f,
"exit 0\n");
3455 path.
Form(
"%s/SETUP.C", proofinf);
3457 f = fopen(path.
Data(),
"wb");
3459 f = fopen(path.
Data(),
"w");
3462 Error(
"MakeProjectParProofInf",
"cannot create file '%s' (errno: %d)",
3467 fprintf(
f,
"Int_t SETUP()\n");
3471 fprintf(
f,
"// The environment variables ROOTPROOFLITE and ROOTPROOFCLIENT can be used to\n");
3472 fprintf(
f,
"// adapt the macro to the calling environment\n");
3474 fprintf(
f,
"// if (gSystem->Getenv(\"ROOTPROOFLITE\")) {\n");
3475 fprintf(
f,
"// Printf(\"event-SETUP: PROOF-Lite node (session has %%s workers)\",\n");
3476 fprintf(
f,
"// gSystem->Getenv(\"ROOTPROOFLITE\"));\n");
3477 fprintf(
f,
"// } else if (gSystem->Getenv(\"ROOTPROOFCLIENT\")) {\n");
3478 fprintf(
f,
"// Printf(\"event-SETUP: PROOF client\");\n");
3479 fprintf(
f,
"// } else {\n");
3480 fprintf(
f,
"// Printf(\"event-SETUP: standard PROOF node\");\n");
3481 fprintf(
f,
"// }\n");
3483 fprintf(
f,
" if (gSystem->Load(\"lib%s\") == -1)\n", pack);
3484 fprintf(
f,
" return -1;\n");
3485 fprintf(
f,
" return 0;\n");
3507 TList *list = listRetcode.fList;
3508 auto retcode = listRetcode.fReturnCode;
3521 if (version > 1000000) version -= 1000000;
3522 if (version < 53419 || (59900 < version && version < 59907)) {
3537 if (!base)
continue;
3549 for (
int mode=0;mode<2; ++mode) {
3562 if (strcmp(obj->
GetName(),
"listOfRules")==0) {
3570 rulelnk = rulelnk->
Next();
3574 Warning(
"ReadStreamerInfo",
"%s has a %s in the list of TStreamerInfo.",
GetName(), info->IsA()->
GetName());
3584 Warning(
"ReadStreamerInfo",
"The StreamerInfo for %s does not have a list of elements.",info->
GetName());
3589 Bool_t isstl = element && strcmp(
"This",element->
GetName())==0;
3591 if ( (!isstl && mode ==0) || (isstl && mode ==1) ) {
3600 printf(
"ReadStreamerInfo, class:%s, illegal uid=%d\n",info->
GetName(),uid);
3666 for (
Int_t i=0;i<npids;i++) {
3678 Info(
"WriteProcessID",
"name=%s, file=%s", name,
GetName());
3712 listOfRules.
SetName(
"listOfRules");
3713 std::set<TClass*> classSet;
3720 if (
gDebug > 0) printf(
" -class: %s info number %d saved\n",info->
GetName(),uid);
3726 if ( classSet.find( clinfo ) == classSet.end() ) {
3727 if (
gDebug > 0) printf(
" -class: %s stored the I/O customization rules\n",info->
GetName());
3734 listOfRules.
Add(obj);
3736 classSet.insert(clinfo);
3747 list.
Add(&listOfRules);
3779 "you want to read through a cache, but you have no valid cache "
3780 "directory set - reading remotely");
3781 ::Info(
"TFile::OpenFromCache",
"set cache directory using TFile::SetCacheFileDir()");
3790 "you want to read through a cache, but you are reading "
3791 "local files - CACHEREAD disabled");
3798 cachefilepath += fileurl.
GetFile();
3802 ::Warning(
"TFile::OpenFromCache",
"you want to read through a cache, but I "
3803 "cannot create the directory %s - CACHEREAD disabled",
3804 cachefilepathbasedir.
Data());
3809 cachefilepath +=
"__";
3813 if (strstr(
name,
"zip=")) {
3818 Int_t optioncount = 0;
3827 if (optioncount!=0) {
3832 newoptions += value;
3842 cachefilepath +=
"__";
3843 cachefilepath += zipname;
3857 char cacheblock[256];
3858 char remotblock[256];
3861 cfurl = cachefilepath;
3862 cfurl +=
"?filetype=raw";
3865 ropt +=
"&filetype=raw";
3878 ::Error(
"TFile::OpenFromCache",
3879 "cannot open the cache file to check cache consistency");
3884 ::Error(
"TFile::OpenFromCache",
3885 "cannot open the remote file to check cache consistency");
3892 if ((!cachefile->
ReadBuffer(cacheblock,256)) &&
3894 if (memcmp(cacheblock, remotblock, 256)) {
3895 ::Warning(
"TFile::OpenFromCache",
"the header of the cache file "
3896 "differs from the remote file - forcing an update");
3900 ::Warning(
"TFile::OpenFromCache",
"the header of the cache and/or "
3901 "remote file are not readable - forcing an update");
3916 ::Warning(
"TFile::OpenFromCache",
"you want to read through a cache, but I "
3917 "cannot make a cache copy of %s - CACHEREAD disabled",
3918 cachefilepathbasedir.
Data());
3924 ::Info(
"TFile::OpenFromCache",
"using local cache copy of %s [%s]",
3928 fileurl.
SetFile(cachefilepath);
3932 tagfile = cachefilepath;
3933 tagfile +=
".ROOT.cachefile";
3989 if (!url || strlen(url) <= 0) {
3990 ::Error(
"TFile::Open",
"no url specified");
4003 TString sto = opts(ito + strlen(
"TIMEOUT="), opts.
Length());
4008 if (
gDebug > 0)
::Info(
"TFile::Open",
"timeout of %d millisec requested", toms);
4010 sto.
Insert(0,
"TIMEOUT=");
4028 ::Info(
"TFile::Open",
"waited %d millisec for asynchronous open", toms - xtms);
4030 ::Info(
"TFile::Open",
"timeout option not supported (requires asynchronous"
4035 ::Error(
"TFile::Open",
"timeout expired while opening '%s'", expandedUrl.
Data());
4042 ::Warning(
"TFile::Open",
"incomplete 'TIMEOUT=' option specification - ignored");
4048 const char *option = opts;
4051 TString namelist(expandedUrl);
4068 while (namelist.
Tokenize(
n, from,
"|") && !
f) {
4071 if (!strcasecmp(option,
"CACHEREAD") ||
4098 f = (
TFile*)
gROOT->ProcessLineFast(
TString::Format(
"new TParallelMergingFile(\"%s\",\"%s\",\"%s\",%d)",
n.Data(),option,ftitle,compress));
4111 lfname = urlname.
GetUrl();
4113 f =
new TFile(lfname.
Data(), option, ftitle, compress);
4118 if ((
h =
gROOT->GetPluginManager()->FindHandler(
"TFile",
name))) {
4119 if (
h->LoadPlugin() == -1)
4121 f = (
TFile*)
h->ExecPlugin(5,
name.Data(), option, ftitle, compress, netopt);
4127 if ((
h =
gROOT->GetPluginManager()->FindHandler(
"TFile",
name))) {
4128 if (
h->LoadPlugin() == -1)
4130 f = (
TFile*)
h->ExecPlugin(2,
name.Data(), option);
4136 if ((
h =
gROOT->GetPluginManager()->FindHandler(
"TFile",
name)) &&
4137 h->LoadPlugin() == 0) {
4138 name.ReplaceAll(
"file:",
"");
4139 f = (
TFile*)
h->ExecPlugin(4,
name.Data(), option, ftitle, compress);
4141 f =
new TFile(
name.Data(), option, ftitle, compress);
4146 if ((
h =
gROOT->GetPluginManager()->FindHandler(
"TFile",
name.Data()))) {
4147 if (
h->LoadPlugin() == -1)
4151 f = (
TFile*)
h->ExecPlugin(5,
name.Data(), option, ftitle, compress, netopt);
4153 f = (
TFile*)
h->ExecPlugin(4,
name.Data(), option, ftitle, compress);
4162 if (
f &&
f->IsZombie()) {
4185 f &&
f->IsWritable() && !
f->IsRaw()) {
4220 const char *ftitle,
Int_t compress,
4229 if (!url || strlen(url) <= 0) {
4230 ::Error(
"TFile::AsyncOpen",
"no url specified");
4242 TString outf =
".TFileAsyncOpen_";
4253 while (namelist.
Tokenize(
n, from,
"|") && !
f) {
4266 if ((
h =
gROOT->GetPluginManager()->FindHandler(
"TFile",
name)) &&
4267 (!strcmp(
h->GetClass(),
"TXNetFile") || !strcmp(
h->GetClass(),
"TNetXNGFile"))
4268 &&
h->LoadPlugin() == 0) {
4269 f = (
TFile*)
h->ExecPlugin(6,
name.Data(), option, ftitle, compress, netopt,
kTRUE);
4273 if ((
h =
gROOT->GetPluginManager()->FindHandler(
"TFile",
name)) &&
4274 !strcmp(
h->GetClass(),
"TAlienFile") &&
h->LoadPlugin() == 0) {
4275 f = (
TFile*)
h->ExecPlugin(5,
name.Data(), option, ftitle, compress,
kTRUE);
4285 if (!notfound && !
f)
4330 if ((
f = fh->
GetFile()) && !(
f->IsZombie())) {
4332 Bool_t cr = (!strcmp(
f->GetOption(),
"CREATE") ||
4333 !strcmp(
f->GetOption(),
"RECREATE") ||
4344 if (
f)
f->fAsyncHandle = fh;
4356#if defined(R__WINGCC)
4360#elif defined(R__SEEK64)
4361 return ::open64(pathname, flags, mode);
4372 if (fd < 0)
return 0;
4381 return ::read(fd, buf, len);
4389 return ::write(fd, buf, len);
4400#if defined (R__SEEK64)
4401 return ::lseek64(fd, offset, whence);
4403 return ::_lseeki64(fd, offset, whence);
4405 return ::lseek(fd, offset, whence);
4432 return ::_commit(fd);
4510 ::Error(
"TFile::SetCacheFileDir",
"no sufficient permissions on cache directory %s or cannot create it",
TString(cachedir).Data());
4552 cachetagfile +=
".tag.ROOT.cache";
4556 if (lastcleanuptime < cleanupinterval) {
4557 ::Info(
"TFile::ShrinkCacheFileDir",
"clean-up is skipped - last cleanup %lu seconds ago - you requested %lu", lastcleanuptime, cleanupinterval);
4563 cachetagfile +=
"?filetype=raw";
4566 if (!(tagfile =
TFile::Open(cachetagfile,
"RECREATE"))) {
4567 ::Error(
"TFile::ShrinkCacheFileDir",
"cannot create the cache tag file %s", cachetagfile.
Data());
4575#if defined(R__WIN32)
4576 cmd =
"echo <TFile::ShrinkCacheFileDir>: cleanup to be implemented";
4577#elif defined(R__MACOSX)
4578 cmd.
Form(
"perl -e 'my $cachepath = \"%s\"; my $cachesize = %lld;my $findcommand=\"find $cachepath -type f -exec stat -f \\\"\\%%a::\\%%N::\\%%z\\\" \\{\\} \\\\\\;\";my $totalsize=0;open FIND, \"$findcommand | sort -k 1 |\";while (<FIND>) { my ($accesstime, $filename, $filesize) = split \"::\",$_; $totalsize += $filesize;if ($totalsize > $cachesize) {if ( ( -e \"${filename}.ROOT.cachefile\" ) || ( -e \"${filename}\" ) ) {unlink \"$filename.ROOT.cachefile\";unlink \"$filename\";}}}close FIND;' ",
fgCacheFileDir.
Data(),shrinksize);
4580 cmd.
Form(
"perl -e 'my $cachepath = \"%s\"; my $cachesize = %lld;my $findcommand=\"find $cachepath -type f -exec stat -c \\\"\\%%x::\\%%n::\\%%s\\\" \\{\\} \\\\\\;\";my $totalsize=0;open FIND, \"$findcommand | sort -k 1 |\";while (<FIND>) { my ($accesstime, $filename, $filesize) = split \"::\",$_; $totalsize += $filesize;if ($totalsize > $cachesize) {if ( ( -e \"${filename}.ROOT.cachefile\" ) || ( -e \"${filename}\" ) ) {unlink \"$filename.ROOT.cachefile\";unlink \"$filename\";}}}close FIND;' ",
fgCacheFileDir.
Data(),shrinksize);
4587 ::Error(
"TFile::ShrinkCacheFileDir",
"error executing clean-up script");
4717 forceRemote =
kTRUE;
4718 else if (opts.
Contains(
"remote=0"))
4727 if (fname[0] ==
'/') {
4729 lfname.
Form(
"%s%s", prefix->
Data(), fname);
4732 }
else if (fname[0] ==
'~' || fname[0] ==
'$') {
4750 if (localFile && prefix)
4757 }
else if (
TPMERegexp(
"^(http[s]?|s3http[s]?|[a]?s3|gs|gshttp[s]?){1}:",
"i").
Match(
name)) {
4761 }
else if (!strncmp(
name,
"file:", 5)) {
4787 if (of && (of->
GetSize() > 0)) {
4790 while ((
f = (
TFile *)nxf()))
4791 if (
f->Matches(
name))
4792 return f->GetAsyncOpenStatus();
4804 if (handle && handle->
fFile) {
4834 if (of && (of->
GetSize() > 0)) {
4837 while ((
f = (
TFile *)nxf()))
4838 if (
f->Matches(
name))
4839 return f->GetEndpointUrl();
4843 return (
const TUrl *)0;
4851 fprintf(stderr,
"[TFile::Cp] Total %.02f MB\t|", (
Double_t)size/1048576);
4853 for (
int l = 0;
l < 20;
l++) {
4855 if (
l < 20*bytesread/size)
4856 fprintf(stderr,
"=");
4857 else if (
l == 20*bytesread/size)
4858 fprintf(stderr,
">");
4859 else if (
l > 20*bytesread/size)
4860 fprintf(stderr,
".");
4862 fprintf(stderr,
"=");
4868 fprintf(stderr,
"| %.02f %% [%.01f MB/s]\r",
4869 100.0*(size?(bytesread/((
float)size)):1), (lCopy_time>0.)?bytesread/lCopy_time/1048576.:0.);
4893 if (opt !=
"") opt +=
"&";
4902 char *copybuffer = 0;
4904 TFile *sfile =
this;
4921 ::Error(
"TFile::Cp",
"cannot open destination file %s", dst);
4927 rmdestiferror =
kTRUE;
4932 copybuffer =
new char[buffersize];
4934 ::Error(
"TFile::Cp",
"cannot allocate the copy buffer");
4952 if (progressbar)
CpProgress(totalread, filesize,watch);
4957 if (filesize - b1 > (
Long64_t)buffersize) {
4958 readsize = buffersize;
4960 readsize = filesize - b1;
4963 if (readsize == 0)
break;
4969 if ((read <= 0) || readop) {
4970 ::Error(
"TFile::Cp",
"cannot read from source file %s. readsize=%lld read=%lld readop=%d",
4971 sfile->
GetName(), readsize, read, readop);
4978 if ((written != read) || writeop) {
4979 ::Error(
"TFile::Cp",
"cannot write %lld bytes to destination file %s", read, dst);
4983 }
while (read == (
Long64_t)buffersize);
4987 fprintf(stderr,
"\n");
4993 if (dfile) dfile->
Close();
4995 if (dfile)
delete dfile;
4996 if (copybuffer)
delete[] copybuffer;
4998 if (rmdestiferror && (success !=
kTRUE))
5021 if (opt !=
"") opt +=
"&";
5027 opt +=
TString::Format(
"&cachesz=%d&readaheadsz=%d&rmpolicy=1", 4*buffersize, 2*buffersize);
5036 ::Error(
"TFile::Cp",
"cannot open source file %s", src);
5038 success = sfile->
Cp(dst, progressbar, buffersize);
5041 if (sfile) sfile->
Close();
5042 if (sfile)
delete sfile;
5051#if defined(R__neverLINUX) && !defined(R__WINGCC)
5063 int advice = POSIX_FADV_WILLNEED;
5068 advice = POSIX_FADV_NORMAL;
5072#if defined(R__SEEK64)
5073 Int_t result = posix_fadvise64(
fD, offset, len, advice);
5075 Int_t result = posix_fadvise(
fD, offset, len, advice);
5080 return (result != 0);
5102 return ((bytes < 0) ? 0 : bytes);
void frombuf(char *&buf, Bool_t *x)
void tobuf(char *&buf, Bool_t x)
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
void Info(const char *location, const char *msgfmt,...)
R__EXTERN TPluginManager * gPluginMgr
R__EXTERN TVirtualMutex * gROOTMutex
void Printf(const char *fmt,...)
typedef void((*Func_t)())
Bool_t R_ISDIR(Int_t mode)
R__EXTERN TSystem * gSystem
R__EXTERN void **(* gThreadTsd)(void *, Int_t)
R__EXTERN TVirtualMonitoringWriter * gMonitoringWriter
#define R__RWLOCK_RELEASE_WRITE(rwlock)
#define R__RWLOCK_RELEASE_READ(rwlock)
#define R__RWLOCK_ACQUIRE_WRITE(rwlock)
#define R__LOCKGUARD(mutex)
#define R__RWLOCK_ACQUIRE_READ(rwlock)
const TMatches FindRules(const TString &source) const
Return all the rules that are about the given 'source' class.
const TObjArray * GetRules() const
This class is a TS set of unsigned set.
bool Insert(char *buf, int len) const
If the hash is there, return false. Otherwise, insert the hash and return true;.
static HashValue Hash(char *buf, int len)
Return the hash object corresponding to the buffer.
bool Find(const HashValue &hash) const
Return true if the hash is already in already there.
void AsString(TString &out, const char *options="") const
Add to the string 'out' the string representation of the rule.
const char * GetMemberName() const
virtual Int_t SetCurrentMember()=0
const char * GetArchiveName() const
TArchiveMember * GetMember() const
static TArchiveFile * Open(const char *url, TFile *file)
Return proper archive file handler depending on passed url.
Long64_t GetMemberFilePosition() const
Return position in archive of current member.
virtual Int_t OpenArchive()=0
Long64_t GetDecompressedSize() const
Array of chars or bytes (8 bits per element).
void Set(Int_t n)
Set size of this array to n chars.
Buffer base class used for serializing objects.
TClass instances represent classes, structs and namespaces in the ROOT type system.
ROOT::ESTLType GetCollectionType() const
Return the 'type' of the STL the TClass is representing.
Bool_t HasInterpreterInfo() const
const ROOT::Detail::TSchemaRuleSet * GetSchemaRules() const
Return the set of the schema rules if any.
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
static Bool_t AddRule(const char *rule)
Add a schema evolution customization rule.
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Version_t GetClassVersion() const
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
virtual void ls(Option_t *option="") const
List (ls) all objects in this collection.
void SetName(const char *name)
virtual Int_t GetEntries() const
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual TObject * Clone(const char *newname="") const
Make a clone of an collection using the Streamer facility.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
static void GetDateTime(UInt_t datetime, Int_t &date, Int_t &time)
Static function that returns the date and time.
void ReadBuffer(char *&buffer)
Decode Date/Time from output buffer, used by I/O system.
A ROOT file is structured in Directories (like a file system).
virtual Int_t GetNkeys() const
virtual Int_t WriteTObject(const TObject *obj, const char *name=0, Option_t *option="", Int_t bufsize=0)
Write object obj to this directory.
virtual Int_t ReadKeys(Bool_t forceRead=kTRUE)
Read the linked list of keys.
void SetWritable(Bool_t writable=kTRUE)
Set the new value of fWritable recursively.
TDatime fDatimeM
Date and time of last modification.
virtual Int_t Sizeof() const
Return the size in bytes of the directory header.
virtual void Delete(const char *namecycle="")
Delete Objects or/and keys in a directory.
Int_t AppendKey(TKey *key)
Insert key in the linked list of keys of this directory.
Int_t fNbytesKeys
Number of bytes for the keys.
virtual void Save()
Save recursively all directory keys and headers.
virtual void Close(Option_t *option="")
Delete all objects from memory and directory structure itself.
void Build(TFile *motherFile=0, TDirectory *motherDir=0)
Initialise directory to defaults.
virtual TFile * GetFile() const
Long64_t fSeekKeys
Location of Keys record on file.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
virtual void FillBuffer(char *&buffer)
Encode directory header into output buffer.
virtual Int_t Write(const char *name=0, Int_t opt=0, Int_t bufsize=0)
Write all objects in memory to disk.
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
Long64_t fSeekParent
Location of parent directory on file.
Long64_t fSeekDir
Location of directory on file.
Int_t fNbytesName
Number of bytes in TNamed at creation time.
TDatime fDatimeC
Date and time when directory is created.
Bool_t fWritable
True if directory is writable.
virtual void ls(Option_t *option="") const
List Directory contents.
Bool_t IsWritable() const
TList * fKeys
Pointer to keys list in memory.
Describe directory structure in memory.
virtual TList * GetList() const
virtual void SetName(const char *newname)
Set the name for directory If the directory name is changed after the directory was written once,...
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
A cache when reading files over the network.
virtual Int_t ReadBuffer(char *buf, Long64_t pos, Int_t len)
Read buffer at position pos.
virtual void Close(Option_t *option="")
Close out any threads or asynchronous fetches used by the underlying implementation.
virtual Int_t GetBufferSize() const
virtual void SetFile(TFile *file, TFile::ECacheAction action=TFile::kDisconnect)
Set the file using this cache and reset the current blocks (if any).
A cache when writing files over the network.
virtual Bool_t Flush()
Flush the current write buffer to the file.
virtual Int_t ReadBuffer(char *buf, Long64_t pos, Int_t len)
Called by the read cache to check if the requested data is not in the write cache buffer.
virtual Int_t GetBytesInCache() const
virtual Int_t WriteBuffer(const char *buf, Long64_t pos, Int_t len)
Write buffer at position pos in the write buffer.
Class holding info about the file being opened.
TFile * fFile
TFile instance of the file being opened.
const char * GetOpt() const
Bool_t Matches(const char *name)
Return kTRUE if this async request matches the open request specified by 'url'.
Int_t GetCompress() const
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
virtual void ls(Option_t *option="") const
List file contents.
static std::atomic< Long64_t > fgBytesRead
Number of bytes read by all TFile objects.
Int_t fReadCalls
Number of read calls ( not counting the cache calls )
static void SetFileBytesWritten(Long64_t bytes=0)
static Bool_t fgCacheFileForce
Indicates, to force all READ to CACHEREAD.
Long64_t fBytesRead
Number of bytes read from this file.
virtual TProcessID * ReadProcessID(UShort_t pidf)
The TProcessID with number pidf is read from this file.
virtual void Seek(Long64_t offset, ERelativeTo pos=kBeg)
Seek to a specific position in the file. Pos it either kBeg, kCur or kEnd.
static Bool_t GetOnlyStaged()
Returns staged only flag.
static void IncrementFileCounter()
static Bool_t ShrinkCacheFileDir(Long64_t shrinkSize, Long_t cleanupInteval=0)
Try to shrink the cache to the desired size.
Long64_t fSeekFree
Location on disk of free segments structure.
static Int_t fgReadaheadSize
Readahead buffer size.
Double_t fSum2Buffer
Sum of squares of buffer sizes of objects written so far.
static void SetReadaheadSize(Int_t bufsize=256000)
static Bool_t fgCacheFileDisconnected
Indicates, we trust in the files in the cache dir without stat on the cached file.
const TList * GetStreamerInfoCache()
Returns the cached list of StreamerInfos used in this file.
static Bool_t GetReadStreamerInfo()
If the streamerinfos are to be read at file opening.
TArchiveFile * fArchive
!Archive file from which we read this file
virtual void Delete(const char *namecycle="")
Delete object namecycle.
virtual Int_t SysSync(Int_t fd)
Interface to system fsync. All arguments like in POSIX fsync().
virtual void Close(Option_t *option="")
Close a file.
virtual Int_t ReOpen(Option_t *mode)
Reopen a file with a different access mode.
virtual void ReadStreamerInfo()
Read the list of StreamerInfo from this file.
virtual Bool_t Matches(const char *name)
Return kTRUE if 'url' matches the coordinates of this file.
TArrayC * fClassIndex
!Index of TStreamerInfo classes written to this file
static Long64_t GetFileBytesWritten()
Static function returning the total number of bytes written to all files.
virtual InfoListRet GetStreamerInfoListImpl(bool lookupSICache)
See documentation of GetStreamerInfoList for more details.
static void SetReadStreamerInfo(Bool_t readinfo=kTRUE)
Specify if the streamerinfos must be read at file opening.
virtual Int_t Sizeof() const
Return the size in bytes of the file header.
Bool_t fNoAnchorInName
!True if we don't want to force the anchor to be appended to the file name
static void SetFileBytesRead(Long64_t bytes=0)
Long64_t fSeekInfo
Location on disk of StreamerInfo record.
Int_t GetBestBuffer() const
Return the best buffer size of objects on this file.
TList * fOpenPhases
!Time info about open phases
virtual void SetCompressionLevel(Int_t level=ROOT::RCompressionSetting::ELevel::kUseMin)
See comments for function SetCompressionSettings.
TFileCacheWrite * GetCacheWrite() const
Return a pointer to the current write cache.
static void SetFileReadCalls(Int_t readcalls=0)
static TString fgCacheFileDir
Directory where to locally stage files.
virtual Int_t SysRead(Int_t fd, void *buf, Int_t len)
Interface to system read. All arguments like in POSIX read().
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'.
Int_t fVersion
File format version.
virtual void FillBuffer(char *&buffer)
Encode file output buffer.
static std::atomic< Long64_t > fgFileCounter
Counter for all opened files.
virtual EAsyncOpenStatus GetAsyncOpenStatus()
static UInt_t GetOpenTimeout()
Returns open timeout (in ms).
static void CpProgress(Long64_t bytesread, Long64_t size, TStopwatch &watch)
Print file copy progress.
static Bool_t fgOnlyStaged
Before the file is opened, it is checked, that the file is staged, if not, the open fails.
virtual Int_t GetNProcessIDs() const
Bool_t fMustFlush
!True if the file buffers must be flushed
Int_t WriteBufferViaCache(const char *buf, Int_t len)
Write buffer via cache.
static ROOT::TRWSpinLock fgRwLock
!Read-write lock to protect global PID list
static Long64_t GetFileBytesRead()
Static function returning the total number of bytes read from all files.
Int_t ReadBufferViaCache(char *buf, Int_t len)
Read buffer via cache.
virtual TKey * CreateKey(TDirectory *mother, const TObject *obj, const char *name, Int_t bufsize)
Creates key for object and converts data to buffer.
virtual void WriteFree()
Write FREE linked list on the file.
static Int_t GetReadaheadSize()
Static function returning the readahead buffer size.
virtual Bool_t ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf)
Read the nbuf blocks described in arrays pos and len.
static Long64_t GetFileCounter()
TMap * fCacheReadMap
!Pointer to the read cache (if any)
Long64_t fBEGIN
First used byte in file.
Int_t MakeProjectParProofInf(const char *packname, const char *proofinfdir)
Create BUILD.sh and SETUP.C under 'proofinf' for PAR package 'pack'.
virtual UShort_t WriteProcessID(TProcessID *pid)
Check if the ProcessID pidd is already in the file, if not, add it and return the index number in the...
virtual void MakeProject(const char *dirname, const char *classes="*", Option_t *option="new")
Generate source code necessary to access the objects stored in the file.
Long64_t fArchiveOffset
!Offset at which file starts in archive
Int_t fNbytesInfo
Number of bytes for StreamerInfo record.
virtual Long64_t GetSize() const
Returns the current file size.
virtual Bool_t IsOpen() const
Returns kTRUE in case file is open and kFALSE if file is not open.
TFileOpenHandle * fAsyncHandle
!For proper automatic cleanup
static Bool_t SetOnlyStaged(Bool_t onlystaged)
Sets only staged flag.
virtual Long64_t GetBytesRead() const
virtual Int_t GetErrno() const
Method returning errno.
static Bool_t fgReadInfo
if true (default) ReadStreamerInfo is called when opening a file
virtual void Init(Bool_t create)
Initialize a TFile object.
virtual Int_t Write(const char *name=0, Int_t opt=0, Int_t bufsiz=0)
Write memory objects to this file.
Long64_t GetRelOffset() const
virtual void SetCacheWrite(TFileCacheWrite *cache)
Set a pointer to the write cache.
TString fOption
File options.
virtual Bool_t WriteBuffer(const char *buf, Int_t len)
Write a buffer to the file.
static TFileOpenHandle * AsyncOpen(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseGeneralPurpose, Int_t netopt=0)
Submit an asynchronous open request.
void SumBuffer(Int_t bufsize)
Increment statistics for buffer sizes of objects in this file.
static const char * GetCacheFileDir()
Get the directory where to locally stage/cache remote files.
EAsyncOpenStatus
Asynchronous open request status.
virtual void WriteStreamerInfo()
Write the list of TStreamerInfo as a single object in this file The class Streamer description for al...
virtual Long64_t GetBytesWritten() const
Return the total number of bytes written so far to the file.
Int_t fCompress
Compression level and algorithm.
static TFile *& CurrentFile()
Return the current ROOT file if any.
virtual void SetCompressionAlgorithm(Int_t algorithm=ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
See comments for function SetCompressionSettings.
virtual const TUrl * GetEndpointUrl() const
Int_t fNbytesFree
Number of bytes for free segments structure.
virtual void ResetErrno() const
Method resetting the errno.
Bool_t FlushWriteCache()
Flush the write cache if active.
virtual void IncrementProcessIDs()
Bool_t fIsPcmFile
!True if the file is a ROOT pcm file.
TFileCacheRead * fCacheRead
!Pointer to the read cache (if any)
virtual Int_t SysClose(Int_t fd)
Interface to system close. All arguments like in POSIX close().
TFile()
File default Constructor.
Char_t fUnits
Number of bytes for file pointers.
TObjArray * fProcessIDs
!Array of pointers to TProcessIDs
virtual void ShowStreamerInfo()
Show the StreamerInfo of all classes written to this file.
virtual Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence)
Interface to system lseek.
virtual ~TFile()
File destructor.
virtual Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime)
Return file stat information.
virtual void Print(Option_t *option="") const
Print all objects in the file.
virtual void Draw(Option_t *option="")
Fill Graphics Structure and Paint.
virtual Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode)
Interface to system open. All arguments like in POSIX open().
ECacheAction
TTreeCache flushing semantics.
static UInt_t SetOpenTimeout(UInt_t timeout)
Sets open timeout time (in ms). Returns previous timeout value.
virtual void ReadFree()
Read the FREE 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.
static ROOT::Internal::RConcurrentHashColl fgTsSIHashes
!TS Set of hashes built from read streamer infos
Long64_t fBytesReadExtra
Number of extra bytes (overhead) read by the readahead buffer.
Long64_t fBytesWrite
Number of bytes written to this file.
Bool_t fIsRootFile
!True is this is a ROOT file, raw file otherwise
static Bool_t SetCacheFileDir(ROOT::Internal::TStringView cacheDir, Bool_t operateDisconnected=kTRUE, Bool_t forceCacheread=kFALSE)
virtual void Flush()
Synchronize a file's in-memory and on-disk states.
virtual void Paint(Option_t *option="")
Paint all objects in the file.
TList * fFree
Free segments linked list table.
virtual Bool_t ReadBufferAsync(Long64_t offs, Int_t len)
Bool_t fInitDone
!True if the file has been initialized
virtual void DrawMap(const char *keys="*", Option_t *option="")
Draw map of objects in this file.
virtual void SetCompressionSettings(Int_t settings=ROOT::RCompressionSetting::EDefaults::kUseGeneralPurpose)
Used to specify the compression level and algorithm.
TFileCacheRead * GetCacheRead(const TObject *tree=0) const
Return a pointer to the current read cache.
virtual void MakeFree(Long64_t first, Long64_t last)
Mark unused bytes on the file.
TFileCacheWrite * fCacheWrite
!Pointer to the write cache (if any)
Option_t * GetOption() const
TString fRealName
Effective real file name (not original url)
virtual void SetOffset(Long64_t offset, ERelativeTo pos=kBeg)
Set position from where to start reading.
Long64_t fOffset
!Seek offset cache
static std::atomic< Long64_t > fgBytesWrite
Number of bytes written by all TFile objects.
TList * fInfoCache
!Cached list of the streamer infos in this file
virtual Int_t GetBytesToPrefetch() const
Max number of bytes to prefetch.
static UInt_t fgOpenTimeout
Timeout for open operations in ms - 0 corresponds to blocking i/o.
Int_t MakeProjectParMake(const char *packname, const char *filename)
Create makefile at 'filemake' for PAR package 'pack'.
Long64_t fEND
Last used byte in file.
EAsyncOpenStatus fAsyncOpenStatus
!Status of an asynchronous open request
Double_t fSumBuffer
Sum of buffer sizes of objects written so far.
Bool_t fIsArchive
!True if this is a pure archive file
TObjArray * GetListOfProcessIDs() const
static std::atomic< Int_t > fgReadCalls
Number of bytes read from all TFile objects.
virtual Int_t Recover()
Attempt to recover file if not correctly closed.
virtual TList * GetStreamerInfoList() final
Read the list of TStreamerInfo objects written to this file.
virtual void WriteHeader()
Write File Header.
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.
Int_t fNProcessIDs
Number of TProcessID written to this file.
virtual void SetCacheRead(TFileCacheRead *cache, TObject *tree=0, ECacheAction action=kDisconnect)
Set a pointer to the read cache.
Int_t fWritten
Number of objects written so far.
Int_t GetRecordHeader(char *buf, Long64_t first, Int_t maxbytes, Int_t &nbytes, Int_t &objlen, Int_t &keylen)
Read the logical record header starting at a certain postion.
virtual Bool_t ReadBuffer(char *buf, Int_t len)
Read a buffer from the file.
Float_t GetCompressionFactor()
Return the file compression factor.
virtual Int_t SysWrite(Int_t fd, const void *buf, Int_t len)
Interface to system write. All arguments like in POSIX write().
static Int_t GetFileReadCalls()
Static function returning the total number of read calls from all files.
static TFile * OpenFromCache(const char *name, Option_t *="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseGeneralPurpose, Int_t netopt=0)
Open a file for reading through the file cache.
static TList * fgAsyncOpenRequests
Int_t Sizeof() const
return number of bytes occupied by this TFree on permanent storage
virtual void ReadBuffer(char *&buffer)
Decode one free structure from input buffer.
Long64_t GetFirst() const
virtual void FillBuffer(char *&buffer)
Encode fre structure into output buffer.
TFree * AddFree(TList *lfree, Long64_t first, Long64_t last)
Add a new free segment to the list of free segments.
static void MakeFunctor(const char *name, const char *type, GlobFunc &func)
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual Long64_t GetSeekKey() const
virtual void Delete(Option_t *option="")
Delete an object from the file.
virtual const char * GetClassName() const
virtual Bool_t ReadFile()
Read the key structure from the file.
virtual Int_t WriteFile(Int_t cycle=1, TFile *f=0)
Write the encoded object supported by this key.
void ReadKeyBuffer(char *&buffer)
Decode input buffer.
virtual char * GetBuffer() const
virtual void Add(TObject *obj)
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual void RemoveLast()
Remove the last object of the list.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual TObjLink * FirstLink() const
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
virtual void AddAfter(const TObject *after, TObject *obj)
Insert object after object after in the list.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual void Clear(Option_t *option="")
Remove all objects from the list.
static void GenerateMissingStreamerInfos(TList *extrainfos, TStreamerElement *element)
Generate an empty StreamerInfo for types that are used in templates parameters but are not known in t...
static TString UpdateAssociativeToVector(const char *name)
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
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 FillBuffer(char *&buffer)
Encode TNamed into output buffer.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual const char * GetTitle() const
Returns title of object.
virtual Int_t Sizeof() const
Return size of the TNamed part of the TObject.
virtual const char * GetName() const
Returns name of object.
Iterator of object array.
TObject * Next()
Return next object in array. Returns 0 when no more objects in array.
Int_t IndexOf(const TObject *obj) const
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
Int_t GetEntries() const
Return the number of objects in array (i.e.
TObject * UncheckedAt(Int_t i) const
TObject * At(Int_t idx) const
Wrapper around a TObject so it can be stored in a TList.
TObject * GetObject() const
Collectable string class.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual UInt_t GetUniqueID() const
Return the unique object id.
virtual void SysError(const char *method, const char *msgfmt,...) const
Issue system error message.
R__ALWAYS_INLINE Bool_t IsOnHeap() const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void MayNotUse(const char *method) const
Use this method to signal that a method (defined in a base class) may not be called in a derived clas...
R__ALWAYS_INLINE Bool_t IsZombie() const
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.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
@ kCanDelete
if object in a list can be deleted
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Wrapper for PCRE library (Perl Compatible Regular Expressions).
Int_t Match(const TString &s, UInt_t start=0)
Runs a match on s against the regex 'this' was created with.
A TProcessID identifies a ROOT job in a unique way in time and space.
Int_t IncrementCount()
Increase the reference count to this object.
void CheckInit()
Initialize fObjects.
virtual void Clear(Option_t *option="")
delete the TObjArray pointing to referenced objects this function is called by TFile::Close("R")
static TObjArray * GetPIDs()
static: returns array of TProcessIDs
static TProcessID * GetSessionProcessID()
static function returning the pointer to the session TProcessID
Int_t DecrementCount()
The reference fCount is used to delete the TProcessID in the TFile destructor when fCount = 0.
static TProcessID * GetPID()
static: returns pointer to current TProcessID
static Int_t IncreaseDirLevel()
Increase the indentation level for ls().
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
static const TString & GetEtcDir()
Get the sysconfig directory in the installation. Static utility function.
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
Sequenceable collection abstract base class.
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
void Continue()
Resume a stopped stopwatch.
void Stop()
Stop the stopwatch.
void SetBaseCheckSum(UInt_t cs)
TClass * GetClass() const
Describe Streamer information for one class version.
TObjArray * GetElements() const
void BuildCheck(TFile *file=0)
Check if built and consistent with the class dictionary.
TClass * GetClass() const
Int_t GetClassVersion() const
UInt_t GetCheckSum() const
Int_t GenerateHeaderFile(const char *dirname, const TList *subClasses=0, const TList *extrainfos=0)
Generate header file for the class described by this TStreamerInfo the function is called by TFile::M...
void ToLower()
Change string to lower-case.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
TString & Insert(Ssiz_t pos, const char *s)
Int_t Atoi() const
Return integer value of string.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
void Clear()
Clear string without changing its capacity.
const char * Data() const
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
TString & ReplaceAll(const TString &s1, const TString &s2)
void ToUpper()
Change string to upper case.
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)
TString & Append(const char *cs)
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
virtual void ReadBuffer(char *&buffer)
Read string from I/O buffer.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual const char * GetMakeSharedLib() const
Return the command line use to make a shared library.
virtual void IgnoreInterrupt(Bool_t ignore=kTRUE)
If ignore is true ignore the interrupt signal, else restore previous behaviour.
virtual int Symlink(const char *from, const char *to)
Create a symbolic link from file1 to file2.
static void ResetErrno()
Static function resetting system error number.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
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 int CopyFile(const char *from, const char *to, Bool_t overwrite=kFALSE)
Copy a file.
virtual const char * GetIncludePath()
Get the list of include path.
virtual void ShowOutput(RedirectHandle_t *h)
Display the content associated with the redirection described by the opaque handle 'h'.
virtual Bool_t IsPathLocal(const char *path)
Returns TRUE if the url in 'path' points to the local file system.
virtual int mkdir(const char *name, Bool_t recursive=kFALSE)
Make a file system directory.
virtual Int_t Exec(const char *shellcmd)
Execute a command.
virtual const char * HomeDirectory(const char *userName=0)
Return the user's home directory.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
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 Bool_t ChangeDirectory(const char *path)
Change directory.
virtual FILE * TempFileName(TString &base, const char *dir=0)
Create a secure temporary file by appending a unique 6 letter string to base.
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual const char * GetFlagsDebug() const
Return the debug flags.
virtual const char * GetObjExt() const
Get the object file extension.
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
virtual const char * WorkingDirectory()
Return working directory.
virtual const char * GetLibraries(const char *regexp="", const char *option="", Bool_t isRegexp=kTRUE)
Return a space separated list of loaded shared libraries.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
virtual const char * GetSoExt() const
Get the shared library extension.
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 * GetFlagsOpt() const
Return the optimization flags.
The TTimeStamp encapsulates seconds and ns since EPOCH.
void ReadBuffer(char *&buffer)
Stream UUID from input buffer.
void FillBuffer(char *&buffer)
Stream UUID into output buffer.
This class represents a WWW compatible URL.
const char * GetAnchor() const
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
void SetAnchor(const char *anchor)
const char * GetFileAndOptions() const
Return the file and its options (the string specified behind the ?).
const char * GetFile() const
void SetProtocol(const char *proto, Bool_t setDefaultPort=kFALSE)
Set protocol and, optionally, change the port accordingly.
void SetOptions(const char *opt)
const char * GetHostFQDN() const
Return fully qualified domain name of url host.
const char * GetOptions() const
void SetHost(const char *host)
const char * GetProtocol() const
void SetFile(const char *file)
virtual Bool_t SendFileReadProgress(TFile *)
virtual Bool_t SendFileCloseEvent(TFile *)
virtual Bool_t SendFileWriteProgress(TFile *)
Abstract Interface class describing Streamer information for one class.
virtual Int_t GetClassVersion() const =0
basic_string_view< char > string_view
Namespace for new ROOT classes and functions.
ROOT::ESTLType STLKind(std::string_view type)
Converts STL container name to number.
ROOT::ESTLType IsSTLCont(std::string_view type)
type : type name: vector<list<classA,allocator>,allocator> result: 0 : not stl container code of cont...
int GetSplit(const char *type, std::vector< std::string > &output, int &nestedLoc, EModType mode=TClassEdit::kNone)
Stores in output (after emptying it) the split type.
static constexpr double s
@ kUndefined
Undefined compression algorithm (must be kept the last of the list in case a new algorithm is added).
Simple struct of the return value of GetStreamerInfoListImpl.