79 #define _XOPEN_SOURCE 600 90 # include <sys/types.h> 96 #include "RConfigure.h" 128 #include "compiledata.h" 165 static struct AddPseudoGlobals {
221 Info(
"TFile",
"default ctor");
330 ::Fatal(
"TFile::TFile",
"ROOT system not initialized");
426 if (!create && !recreate && !update && !read) {
433 if (!fname1 || !fname1[0]) {
434 Error(
"TFile",
"file name is not specified");
439 if (!strcmp(fname1,
"/dev/null") &&
457 Error(
"TFile",
"error expanding path %s", fname1);
464 SysError(
"TFile",
"could not delete %s (errno: %d)",
474 Error(
"TFile",
"file %s already exists", fname);
483 Error(
"TFile",
"no write permission, could not open file %s", fname);
489 Error(
"TFile",
"file %s does not exist", fname);
493 Error(
"TFile",
"no read permission, could not open file %s", fname);
499 if (create || update) {
501 fD =
SysOpen(fname, O_RDWR | O_CREAT, 0644);
506 SysError(
"TFile",
"file %s can not be opened", fname);
517 SysError(
"TFile",
"file %s can not be opened for reading", fname);
531 gROOT->GetListOfClosedObjects()->Add(
this);
542 MayNotUse(
"TFile::TFile(const TFile &)");
575 gROOT->GetListOfClosedObjects()->Remove(
this);
612 Error(
"Init",
"archive %s can only be opened in read mode",
GetName());
631 Error(
"Init",
"member %s not found in archive %s",
669 char *header =
new char[
kBEGIN+200];
674 Error(
"Init",
"%s failed to read the file type data.",
681 if (strncmp(header,
"root", 4)) {
687 char *buffer = header + 4;
690 frombuf(buffer, &headerLength);
693 Int_t send,sfree,sinfo;
714 if (fBEGIN < 0 || fBEGIN >
fEND) {
716 Error(
"Init",
"file %s has an incorrect header length (%lld) or incorrect end of file length (%lld)",
727 Warning(
"Init",
"file %s probably not closed, cannot read free segments",
GetName());
732 char *buffer_keyloc = 0;
735 if ( (nbytes +
fBEGIN) > fEND) {
737 Error(
"Init",
"file %s has an incorrect header length (%lld) or incorrect end of file length (%lld)",
743 header =
new char[nbytes];
748 Error(
"Init",
"%s failed to read the file header information at %lld (size=%d)",
754 buffer_keyloc = header;
757 buffer_keyloc = header+
fBEGIN;
760 frombuf(buffer,&version); versiondir = version%1000;
765 if (version > 1000) {
770 Int_t sdir,sparent,skeys;
778 buffer_keyloc +=
sizeof(
Int_t);
780 frombuf(buffer_keyloc, &keyversion);
782 if (keyversion > 1000) {
793 if (fNbytesName < 10 || fNbytesName > 10000) {
794 Error(
"Init",
"cannot read directory info of file %s",
GetName());
800 if ((size =
GetSize()) == -1) {
822 }
else if ((
fBEGIN+nbytes == fEND) && (fEND == size)) {
830 Error(
"Init",
"file %s is truncated at %lld bytes: should be %lld, " 831 "trying to recover",
GetName(), size, fEND);
833 Error(
"Init",
"file %s is truncated at %lld bytes: should be %lld",
839 Warning(
"Init",
"file %s probably not closed, " 840 "trying to recover",
GetName());
848 Warning(
"Init",
"successfully recovered %d keys", nrecov);
850 Warning(
"Init",
"no keys recovered, file has been made a Zombie");
858 gROOT->GetListOfFiles()->Add(
this);
864 Int_t lenIndex =
gROOT->GetListOfStreamerInfo()->GetSize()+1;
865 if (lenIndex < 5000) lenIndex = 5000;
872 gROOT->GetListOfFiles()->Remove(
this);
878 Warning(
"Init",
"no StreamerInfo found in %s therefore preventing schema evolution when reading this file.",
GetName());
888 while ((key = (
TKey*)next())) {
898 gROOT->GetListOfClosedObjects()->Add(
this);
946 while ((key = iter()) != 0) {
1004 gROOT->GetListOfFiles()->Remove(
this);
1005 gROOT->GetListOfBrowsers()->RecursiveRemove(
this);
1006 gROOT->GetListOfClosedObjects()->Add(
this);
1017 return new TKey(obj, name, bufsize, mother);
1025 return new TKey(obj, cl, name, bufsize, mother);
1037 static TFile *currentFile = 0;
1069 Info(
"Delete",
"deleting name = %s", namecycle);
1090 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TFileDrawMap"))) {
1131 Version_t version = TFile::Class_Version();
1132 tobuf(buffer, version);
1160 Int_t nbytes, objlen, nwh = 64;
1161 char *header =
new char[
fBEGIN];
1167 while (idcur <
fEND-100) {
1182 if (nbytes == 0)
break;
1188 if (!objlen) objlen = nbytes-keylen;
1190 uncomp += keylen + objlen;
1258 if (first <
fBEGIN)
return 0;
1259 if (first >
fEND)
return 0;
1261 Int_t nread = maxbytes;
1262 if (first+maxbytes >
fEND) nread =
fEND-maxbytes;
1264 Warning(
"GetRecordHeader",
"%s: parameter maxbytes = %d must be >= 4",
1270 Warning(
"GetRecordHeader",
"%s: failed to read header data (maxbytes = %d)",
1281 if (nb < 0)
return nread;
1283 const Int_t headerSize = 16;
1284 if (nread < headerSize)
return nread;
1289 if (!olen) olen = nbytes-klen;
1307 if (const_cast<TFile*>(
this)->
SysStat(
fD, &
id, &size, &flags, &modtime)) {
1308 Error(
"GetSize",
"cannot stat the file %s",
GetName());
1337 auto key = std::make_unique<TKey>(
this);
1339 auto buf = buffer.data();
1343 Warning(
"GetRecordHeader",
"%s: failed to read the StreamerInfo data from disk.",
1345 return {
nullptr, 1, hash};
1349 if (lookupSICache) {
1352 if (
gDebug > 0)
Info(
"GetStreamerInfo",
"The streamer info record for file %s has already been treated, skipping it.",
GetName());
1353 return {
nullptr, 0, hash};
1357 (
void) lookupSICache;
1359 key->ReadKeyBuffer(buf);
1360 list =
dynamic_cast<TList*
>(key->ReadObjWithBuffer(buffer.data()));
1363 list = (
TList*)
Get(
"StreamerInfo");
1367 Info(
"GetStreamerInfoList",
"cannot find the StreamerInfo record in file %s",
1369 return {
nullptr, 1, hash};
1372 return {list, 0, hash};
1439 if(!newfree)
return;
1443 if (nbytesl > 2000000000) nbytesl = 2000000000;
1446 char * buffer =
new char[nb];
1447 char * psave = buffer;
1448 tobuf(buffer, nbytes);
1507 bool forComp = options.
Contains(
"forcomp");
1511 Int_t nbytes,date,time,objlen,nwheader;
1520 Int_t nread = nwheader;
1523 char classname[512];
1527 while (idcur <
fEND) {
1529 if (idcur+nread >=
fEND) nread =
fEND-idcur-1;
1532 Warning(
"Map",
"%s: failed to read the key data from disk at %lld.",
1540 Printf(
"Address = %lld\tNbytes = %d\t=====E R R O R=======", idcur, nbytes);
1545 Printf(
"Address = %lld\tNbytes = %d\t=====G A P===========", idcur, nbytes);
1556 if (versionkey > 1000) {
1565 for (
int i = 0;i < nwhc; i++)
frombuf(buffer, &classname[i]);
1566 classname[(int)nwhc] =
'\0';
1567 if (idcur ==
fSeekFree) strlcpy(classname,
"FreeSegments",512);
1568 if (idcur ==
fSeekInfo) strlcpy(classname,
"StreamerInfo",512);
1569 if (idcur ==
fSeekKeys) strlcpy(classname,
"KeysList",512);
1572 if (objlen != nbytes - keylen) {
1574 Printf(
"%d/%06d At:%-*lld N=%-8d %-14s CX = %5.2f", date, time, nDigits + 1, idcur, nbytes, classname,
1577 Printf(
"%d/%06d At:%-*lld N=%-8d %-14s", date, time, nDigits + 1, idcur, nbytes, classname);
1581 if (objlen != nbytes - keylen) {
1583 Printf(
"At:%-*lld N=%-8d K=%-3d O=%-8d %-14s CX = %5.2f", nDigits+1, idcur, nbytes, keylen, objlen, classname, cx);
1585 Printf(
"At:%-*lld N=%-8d K=%-3d O=%-8d %-14s CX = 1", nDigits+1, idcur, nbytes, keylen, objlen, classname);
1591 Printf(
"%d/%06d At:%-*lld N=%-8d %-14s",date,time, nDigits+1, idcur,1,
"END");
1593 Printf(
"At:%-*lld N=%-8d K= O= %-14s", nDigits+1, idcur,1,
"END");
1648 Error(
"ReadBuffer",
"error reading all requested bytes from file %s, got %ld of %d",
1695 Error(
"ReadBuffer",
"error reading all requested bytes from file %s, got %ld of %d",
1726 for (
Int_t j = 0; j < nbuf; j++) {
1743 cur = pos[i]+len[i];
1746 if (bigRead || (i>=nbuf)) {
1760 Long64_t nahead = pos[i-1]+len[i-1]-curbegin;
1765 for (
Int_t j=0;j<
n;j++) {
1766 memcpy(&buf[k],&buf2[pos[i-n+j]-curbegin],len[i-n+j]);
1776 curbegin = i < nbuf ? pos[i] : 0;
1779 if (buf2)
delete [] buf2;
1829 if (fNbytesFree < 0 || fNbytesFree >
fEND) {
1865 snprintf(pidname,32,
"ProcessID%d",pidf);
1868 printf(
"ReadProcessID, name=%s, file=%s, pid=%lx\n",pidname,
GetName(),(
Long_t)pid);
1877 TIter next(pidslist);
1950 Int_t nbytes,date,time,objlen,nwheader;
1953 char *buffer, *bufread;
1958 if ((size =
GetSize()) == -1) {
1959 Error(
"Recover",
"cannot stat the file %s",
GetName());
1970 Int_t nread = nwheader;
1972 while (idcur <
fEND) {
1974 if (idcur+nread >=
fEND) nread =
fEND-idcur-1;
1977 Error(
"Recover",
"%s: failed to read the key data from disk at %lld.",
1985 Error(
"Recover",
"Address = %lld\tNbytes = %d\t=====E R R O R=======", idcur, nbytes);
2000 if (versionkey > 1000) {
2009 char *classname = 0;
2010 if (nwhc <= 0 || nwhc > 100)
break;
2011 classname =
new char[nwhc+1];
2012 int i, nwhci = nwhc;
2013 for (i = 0;i < nwhc; i++)
frombuf(buffer, &classname[i]);
2014 classname[nwhci] =
'\0';
2018 && strcmp(classname,
"TBasket")) {
2019 key =
new TKey(
this);
2021 if (!strcmp(key->
GetName(),
"StreamerInfo")) {
2032 delete [] classname;
2037 if (max_file_size <
fEND) max_file_size =
fEND+1000000000;
2044 if (nrecov)
Write();
2067 if (opt !=
"READ" && opt !=
"UPDATE") {
2068 Error(
"ReOpen",
"mode must be either READ or UPDATE, not %s", opt.
Data());
2075 if (opt ==
"READ") {
2113 SysError(
"ReOpen",
"file %s can not be opened in read mode",
GetName());
2135 SysError(
"ReOpen",
"file %s can not be opened in update mode",
GetName());
2144 Warning(
"ReOpen",
"file %s probably not closed, cannot read free segments",
GetName());
2165 Error(
"SetOffset",
"seeking from end in archive is not (yet) supported");
2189 Error(
"Seek",
"seeking from end in archive is not (yet) supported");
2193 if ((retpos =
SysSeek(
fD, offset, whence)) < 0)
2194 SysError(
"Seek",
"cannot seek to position %lld in file %s, retpos=%lld",
2222 if (level < 0) level = 0;
2223 if (level > 99) level = 99;
2278 if (cache) cache->
SetFile(
this, action);
2369 Error(
"Write const",
"A const TFile object should not be saved. We try to proceed anyway.");
2370 return const_cast<TFile*
>(
this)->
Write(n, opt, bufsize);
2401 Error(
"WriteBuffer",
"error writing all requested bytes to file %s, wrote %ld of %d",
2428 Error(
"WriteBuffer",
"error writing to cache");
2453 auto createKey = [
this]() {
2457 while ((afree = (
TFree*) next())) {
2458 nbytes += afree->
Sizeof();
2460 if (!nbytes)
return (
TKey*)
nullptr;
2466 return (
TKey*)
nullptr;
2471 TKey *key = createKey();
2488 char *start = buffer;
2492 while ((afree = (
TFree*) next())) {
2497 auto actualBytes = buffer-start;
2498 if ( actualBytes != nbytes ) {
2499 if (actualBytes < nbytes) {
2502 memset(buffer,0,nbytes-actualBytes);
2504 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);
2521 const char *root =
"root";
2522 char *psave =
new char[
fBEGIN];
2523 char *buffer = psave;
2525 memcpy(buffer, root, 4); buffer += 4;
2528 tobuf(buffer, version);
2530 if (version < 1000000) {
2534 tobuf(buffer, nfree);
2544 tobuf(buffer, nfree);
2552 Int_t nbytes = buffer - psave;
2643 path +=
"/PROOF-INF";
2645 const char *afile = 0;
2648 if (strcmp(afile,
".") == 0)
continue;
2649 if (strcmp(afile,
"..") == 0)
continue;
2650 filepath.
Form(
"%s/%s", path.
Data(), afile);
2652 Warning(
"MakeProject",
"1: problems unlinking '%s' ('%s', '%s')", filepath.
Data(), path.
Data(), afile);
2659 if (strcmp(afile,
".") == 0)
continue;
2660 if (strcmp(afile,
"..") == 0)
continue;
2661 filepath.
Form(
"%s/%s", path.
Data(), afile);
2663 Warning(
"MakeProject",
"2: problems unlinking '%s' ('%s', '%s')", filepath.
Data(), path.
Data(), afile);
2667 Warning(
"MakeProject",
"problems unlinking '%s'", path.
Data());
2671 path.
Form(
"%s/%s/PROOF-INF", pardir.
Data(), parname.
Data());
2673 Error(
"MakeProject",
"problems creating '%s'", path.
Data());
2688 }
else if (opt.
Contains(
"recreate")) {
2692 Error(
"MakeProject",
"cannot create directory '%s'",dirname);
2699 if (afile == 0)
break;
2700 if (strcmp(afile,
".") == 0)
continue;
2701 if (strcmp(afile,
"..") == 0)
continue;
2702 dirpath.
Form(
"%s/%s",dirname,afile);
2710 Error(
"MakeProject",
"cannot create directory %s, already existing",dirname);
2715 Error(
"MakeProject",
"cannot create directory '%s'",dirname);
2728 if (filelist) filelist = (
TList*)filelist->
Clone();
2729 if (filelist == 0) {
2730 Error(
"MakeProject",
"file %s has no StreamerInfo",
GetName());
2734 TString clean_dirname(dirname);
2735 if (makepar) clean_dirname.
Form(
"%s/%s", pardir.
Data(), parname.
Data());
2736 if (clean_dirname[clean_dirname.
Length()-1]==
'/') {
2738 }
else if (clean_dirname[clean_dirname.
Length()-1]==
'\\') {
2740 if (clean_dirname[clean_dirname.
Length()-1]==
'\\') {
2745 if (makepar) subdirname = parname;
2746 if (subdirname ==
"") {
2747 Error(
"MakeProject",
"Directory name must not be empty.");
2752 TString spath; spath.
Form(
"%s/%sProjectSource.cxx",clean_dirname.
Data(),subdirname.Data());
2753 FILE *sfp = fopen(spath.
Data(),
"w");
2755 Error(
"MakeProject",
"Unable to create the source file %s.",spath.
Data());
2758 fprintf(sfp,
"namespace std {}\nusing namespace std;\n");
2759 fprintf(sfp,
"#include \"%sProjectHeaders.h\"\n\n",subdirname.Data() );
2760 if (!genreflex) fprintf(sfp,
"#include \"%sLinkDef.h\"\n\n",subdirname.Data() );
2761 fprintf(sfp,
"#include \"%sProjectDict.cxx\"\n\n",subdirname.Data() );
2762 fprintf(sfp,
"struct DeleteObjectFunctor {\n");
2763 fprintf(sfp,
" template <typename T>\n");
2764 fprintf(sfp,
" void operator()(const T *ptr) const {\n");
2765 fprintf(sfp,
" delete ptr;\n");
2766 fprintf(sfp,
" }\n");
2767 fprintf(sfp,
" template <typename T, typename Q>\n");
2768 fprintf(sfp,
" void operator()(const std::pair<T,Q> &) const {\n");
2769 fprintf(sfp,
" // Do nothing\n");
2770 fprintf(sfp,
" }\n");
2771 fprintf(sfp,
" template <typename T, typename Q>\n");
2772 fprintf(sfp,
" void operator()(const std::pair<T,Q*> &ptr) const {\n");
2773 fprintf(sfp,
" delete ptr.second;\n");
2774 fprintf(sfp,
" }\n");
2775 fprintf(sfp,
" template <typename T, typename Q>\n");
2776 fprintf(sfp,
" void operator()(const std::pair<T*,Q> &ptr) const {\n");
2777 fprintf(sfp,
" delete ptr.first;\n");
2778 fprintf(sfp,
" }\n");
2779 fprintf(sfp,
" template <typename T, typename Q>\n");
2780 fprintf(sfp,
" void operator()(const std::pair<T*,Q*> &ptr) const {\n");
2781 fprintf(sfp,
" delete ptr.first;\n");
2782 fprintf(sfp,
" delete ptr.second;\n");
2783 fprintf(sfp,
" }\n");
2784 fprintf(sfp,
"};\n\n");
2791 TIter flnext(filelist);
2798 if (strstr(info->
GetName(),
"@@")) {
2815 for(
auto rule : rules) {
2816 if( rule->IsRenameRule() || rule->IsAliasRule() )
2819 if ( rule->HasTarget( el->GetName()) && rule->GetAttributes()[0] != 0 ) {
2820 TString attr( rule->GetAttributes() );
2822 if (attr.Contains(
"owner")) {
2823 if (attr.Contains(
"notowner")) {
2846 TIter nextextra(&extrainfos);
2849 filelist->
Add(info);
2860 TIter subnext(list);
2872 if ( (sublen > len) && subinfo->
GetName()[len+1]==
':' 2875 subClasses.
Add(subinfo);
2880 subClasses.
Clear(
"nodelete");
2883 path.
Form(
"%s/%sProjectHeaders.h",clean_dirname.
Data(),subdirname.Data());
2884 FILE *allfp = fopen(path,
"a");
2886 Error(
"MakeProject",
"Cannot open output file:%s\n",path.
Data());
2888 fprintf(allfp,
"#include \"%sProjectInstances.h\"\n", subdirname.Data());
2892 printf(
"MakeProject has generated %d classes in %s\n",ngener,clean_dirname.
Data());
2895 if (!opt.
Contains(
"+") && !makepar) {
2908 path.
Form(
"%s/makep.cmd",clean_dirname.
Data());
2910 path.
Form(
"%s/MAKEP",clean_dirname.
Data());
2913 fpMAKE = fopen(path,
"wb");
2915 fpMAKE = fopen(path,
"w");
2918 Error(
"MakeProject",
"cannot open file %s", path.
Data());
2928 path.
Form(
"%s/%sProjectInstances.h",clean_dirname.
Data(),subdirname.Data());
2930 ifp = fopen(path,
"wb");
2932 ifp = fopen(path,
"w");
2935 Error(
"MakeProject",
"cannot open path file %s", path.
Data());
2945 fprintf(fpMAKE,
"genreflex %sProjectHeaders.h -o %sProjectDict.cxx --comments --iocomments %s ",subdirname.Data(),subdirname.Data(),
gSystem->
GetIncludePath());
2946 path.
Form(
"%s/%sSelection.xml",clean_dirname.
Data(),subdirname.Data());
2948 fprintf(fpMAKE,
"rootcint -v1 -f %sProjectDict.cxx -c %s ",subdirname.Data(),
gSystem->
GetIncludePath());
2949 path.
Form(
"%s/%sLinkDef.h",clean_dirname.
Data(),subdirname.Data());
2952 path.
Form(
"%s/%sLinkDef.h",clean_dirname.
Data(),subdirname.Data());
2958 FILE *fp = fopen(path,
"wb");
2960 FILE *fp = fopen(path,
"w");
2963 Error(
"MakeProject",
"cannot open path file %s", path.
Data());
2972 fprintf(fp,
"<lcgdict>\n");
2975 fprintf(fp,
"#ifdef __CINT__\n");
2993 for(
auto rule : rules) {
2996 rule->AsString(strrule,
"x");
2999 selections.
Append(strrule);
3002 rule->AsString(strrule);
3003 if (strncmp(strrule.
Data(),
"type=",5)==0) {
3006 fprintf(fp,
"#pragma %s;\n",strrule.
Data());
3013 std::vector<std::string> inside;
3020 switch ( stlkind ) {
3024 what =
"std::pair<";
3028 if (what[what.
Length()-1]==
'>') {
3034 tmp.
Form(
"<class name=\"%s\" />\n",what.
Data());
3038 tmp.
Form(
"template class %s;\n",what.
Data());
3046 fprintf(fp,
"#pragma link C++ class %s+;\n",what.
Data());
3052 if (strncmp(key->
GetName(),
"pair<",strlen(
"pair<"))==0) {
3054 tmp.
Form(
"<class name=\"%s\" />\n",key->
GetName());
3064 fprintf(fp,
"#pragma link C++ class %s+;\n",key->
GetName());
3075 tmp.
Form(
"<class name=\"%s\" />\n",what.Data());
3079 if (what[what.Length()-1] ==
'>') {
3080 tmp.
Form(
"template class %s;\n",what.Data());
3087 fprintf(fp,
"#pragma link C++ class %s+;\n",what.Data());
3095 if (element->GetClass() && !element->GetClass()->IsLoaded() && element->GetClass()->GetCollectionProxy()) {
3097 tmp.
Form(
"<class name=\"%s\" />\n",what.
Data());
3101 tmp.
Form(
"template class %s;\n",what.
Data());
3110 fprintf(ifp,
"#ifndef PROJECT_INSTANCES_H\n");
3111 fprintf(ifp,
"#define PROJECT_INSTANCES_H\n");
3112 fprintf(ifp,
"%s",instances.
Data());
3113 fprintf(ifp,
"#endif\n");
3114 fprintf(fp,
"%s",selections.
Data());
3115 fprintf(fp,
"</lcgdict>\n");
3117 fprintf(fp,
"#endif\n");
3131 cmd.
ReplaceAll(
"$ObjectFiles",
object.Data());
3138 TString rootbuild = ROOTBUILD;
3147 fprintf(fpMAKE,
"-s %sSelection.xml \n",subdirname.Data());
3149 fprintf(fpMAKE,
"%sProjectHeaders.h ",subdirname.Data());
3150 fprintf(fpMAKE,
"%sLinkDef.h \n",subdirname.Data());
3153 fprintf(fpMAKE,
"%s\n",cmd.
Data());
3155 printf(
"%s/MAKEP file has been generated\n", clean_dirname.
Data());
3164 Error(
"MakeProject",
"problems creating PAR make file '%s'", filemake.
Data());
3173 Warning(
"MakeProject",
"problems expanding '%s'", mkarchsrc.
Data());
3176 Error(
"MakeProject",
"problems retrieving '%s' to '%s'", mkarchsrc.
Data(), mkarchdst.
Data());
3185 Error(
"MakeProject",
"problems creating BUILD.sh and/or SETUP.C under '%s'", proofinf.
Data());
3198 chmod(cmod.
Data(), 00700);
3200 Printf(
"Files Makefile, Makefile.arch, PROOF-INF/BUILD.sh and" 3201 " PROOF-INF/SETUP.C have been generated under '%s'", clean_dirname.
Data());
3210 Info(
"MakeProject",
"PAR file %s.par generated", clean_dirname.
Data());
3212 Warning(
"MakeProject",
"problems changing directory back to '%s'", curdir.Data());
3215 Error(
"MakeProject",
"problems changing directory to '%s' - skipping PAR file generation", pardir.
Data());
3218 Warning(
"MakeProject",
"on Windows systems the PAR file cannot be generated out of the package directory!");
3223 if (!makepar && !opt.
Contains(
"nocompilation")) {
3232 chmod(
"makep.cmd",00700);
3237 if (res) printf(
"Shared lib %s has been generated\n",path.
Data());
3242 if (res) printf(
"Shared lib %s has been dynamically linked\n",path.
Data());
3246 extrainfos.
Clear(
"nodelete");
3262 if (!filemake || (filemake && strlen(filemake) <= 0)) {
3263 Error(
"MakeProjectParMake",
"path for output file undefined!");
3268 if (!pack || (pack && strlen(pack) <= 0)) {
3269 Error(
"MakeProjectParMake",
"package name undefined!");
3274 FILE *fmk = fopen(filemake,
"wb");
3276 FILE *fmk = fopen(filemake,
"w");
3284 fprintf(fmk,
"# Makefile for the ROOT test programs.\n");
3285 fprintf(fmk,
"# This Makefile shows how to compile and link applications\n");
3286 fprintf(fmk,
"# using the ROOT libraries on all supported platforms.\n");
3287 fprintf(fmk,
"#\n");
3288 fprintf(fmk,
"# Copyright (c) 2000 Rene Brun and Fons Rademakers\n");
3289 fprintf(fmk,
"#\n");
3290 fprintf(fmk,
"# Author: this makefile has been automatically generated via TFile::MakeProject\n");
3292 fprintf(fmk,
"include Makefile.arch\n");
3294 fprintf(fmk,
"#------------------------------------------------------------------------------\n");
3296 fprintf(fmk,
"PACKO = %sProjectSource.$(ObjSuf)\n", pack);
3297 fprintf(fmk,
"PACKS = %sProjectSource.$(SrcSuf) %sProjectDict.$(SrcSuf)\n", pack, pack);
3298 fprintf(fmk,
"PACKSO = lib%s.$(DllSuf)\n", pack);
3300 fprintf(fmk,
"ifeq ($(PLATFORM),win32)\n");
3301 fprintf(fmk,
"PACKLIB = lib%s.lib\n", pack);
3302 fprintf(fmk,
"else\n");
3303 fprintf(fmk,
"PACKLIB = $(PACKSO)\n");
3304 fprintf(fmk,
"endif\n");
3306 fprintf(fmk,
"OBJS = $(PACKO)\n");
3308 fprintf(fmk,
"PROGRAMS =\n");
3310 fprintf(fmk,
"#------------------------------------------------------------------------------\n");
3312 fprintf(fmk,
".SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf)\n");
3314 fprintf(fmk,
"all: $(PACKLIB)\n");
3316 fprintf(fmk,
"$(PACKSO): $(PACKO)\n");
3317 fprintf(fmk,
"ifeq ($(ARCH),aix)\n");
3318 fprintf(fmk,
"\t\t/usr/ibmcxx/bin/makeC++SharedLib $(OutPutOpt) $@ $(LIBS) -p 0 $^\n");
3319 fprintf(fmk,
"else\n");
3320 fprintf(fmk,
"ifeq ($(ARCH),aix5)\n");
3321 fprintf(fmk,
"\t\t/usr/vacpp/bin/makeC++SharedLib $(OutPutOpt) $@ $(LIBS) -p 0 $^\n");
3322 fprintf(fmk,
"else\n");
3323 fprintf(fmk,
"ifeq ($(PLATFORM),macosx)\n");
3324 fprintf(fmk,
"# We need to make both the .dylib and the .so\n");
3325 fprintf(fmk,
"\t\t$(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@ $(LIBS)\n");
3326 fprintf(fmk,
"ifneq ($(subst $(MACOSX_MINOR),,1234),1234)\n");
3327 fprintf(fmk,
"ifeq ($(MACOSX_MINOR),4)\n");
3328 fprintf(fmk,
"\t\tln -sf $@ $(subst .$(DllSuf),.so,$@)\n");
3329 fprintf(fmk,
"else\n");
3330 fprintf(fmk,
"\t\t$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ \\\n");
3331 fprintf(fmk,
"\t\t $(OutPutOpt) $(subst .$(DllSuf),.so,$@)\n");
3332 fprintf(fmk,
"endif\n");
3333 fprintf(fmk,
"endif\n");
3334 fprintf(fmk,
"else\n");
3335 fprintf(fmk,
"ifeq ($(PLATFORM),win32)\n");
3336 fprintf(fmk,
"\t\tbindexplib $* $^ > $*.def\n");
3337 fprintf(fmk,
"\t\tlib -nologo -MACHINE:IX86 $^ -def:$*.def \\\n");
3338 fprintf(fmk,
"\t\t $(OutPutOpt)$(PACKLIB)\n");
3339 fprintf(fmk,
"\t\t$(LD) $(SOFLAGS) $(LDFLAGS) $^ $*.exp $(LIBS) \\\n");
3340 fprintf(fmk,
"\t\t $(OutPutOpt)$@\n");
3341 fprintf(fmk,
"else\n");
3342 fprintf(fmk,
"\t\t$(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(LIBS) $(EXPLLINKLIBS)\n");
3343 fprintf(fmk,
"endif\n");
3344 fprintf(fmk,
"endif\n");
3345 fprintf(fmk,
"endif\n");
3346 fprintf(fmk,
"endif\n");
3347 fprintf(fmk,
"\t\t@echo \"$@ done\"\n");
3349 fprintf(fmk,
"clean:\n");
3350 fprintf(fmk,
"\t\t@rm -f $(OBJS) core\n");
3352 fprintf(fmk,
"distclean: clean\n");
3353 fprintf(fmk,
"\t\t@rm -f $(PROGRAMS) $(PACKSO) $(PACKLIB) *Dict.* *.def *.exp \\\n");
3354 fprintf(fmk,
"\t\t *.so *.lib *.dll *.d *.log .def so_locations\n");
3355 fprintf(fmk,
"\t\t@rm -rf cxx_repository\n");
3357 fprintf(fmk,
"# Dependencies\n");
3359 fprintf(fmk,
"%sProjectSource.$(ObjSuf): %sProjectHeaders.h %sLinkDef.h %sProjectDict.$(SrcSuf)\n", pack, pack, pack, pack);
3361 fprintf(fmk,
"%sProjectDict.$(SrcSuf): %sProjectHeaders.h %sLinkDef.h\n", pack, pack, pack);
3362 fprintf(fmk,
"\t\t@echo \"Generating dictionary $@...\"\n");
3363 fprintf(fmk,
"\t\t@rootcint -f $@ -c $^\n");
3365 fprintf(fmk,
".$(SrcSuf).$(ObjSuf):\n");
3366 fprintf(fmk,
"\t\t$(CXX) $(CXXFLAGS) -c $<\n");
3384 if (!proofinf || (proofinf && strlen(proofinf) <= 0)) {
3385 Error(
"MakeProjectParProofInf",
"directory path undefined!");
3393 Error(
"MakeProjectParProofInf",
"path '%s' %s", proofinf,
3394 ((rcst == 0) ?
"is not a directory" :
"does not exist"));
3399 if (!pack || (pack && strlen(pack) <= 0)) {
3400 Error(
"MakeProjectParProofInf",
"package name undefined!");
3407 path.
Form(
"%s/BUILD.sh", proofinf);
3409 FILE *
f = fopen(path.
Data(),
"wb");
3411 FILE *f = fopen(path.
Data(),
"w");
3414 Error(
"MakeProjectParProofInf",
"cannot create file '%s' (errno: %d)",
3419 fprintf(f,
"#! /bin/sh\n");
3420 fprintf(f,
"# Build libEvent library.\n");
3423 fprintf(f,
"# The environment variables ROOTPROOFLITE and ROOTPROOFCLIENT can be used to\n");
3424 fprintf(f,
"# adapt the script to the calling environment\n");
3426 fprintf(f,
"# if test ! \"x$ROOTPROOFLITE\" = \"x\"; then\n");
3427 fprintf(f,
"# echo \"event-BUILD: PROOF-Lite node (session has $ROOTPROOFLITE workers)\"\n");
3428 fprintf(f,
"# elif test ! \"x$ROOTPROOFCLIENT\" = \"x\"; then\n");
3429 fprintf(f,
"# echo \"event-BUILD: PROOF client\"\n");
3430 fprintf(f,
"# else\n");
3431 fprintf(f,
"# echo \"event-BUILD: standard PROOF node\"\n");
3432 fprintf(f,
"# fi\n");
3434 fprintf(f,
"if [ \"\" = \"clean\" ]; then\n");
3435 fprintf(f,
" make distclean\n");
3436 fprintf(f,
" exit 0\n");
3439 fprintf(f,
"make\n");
3440 fprintf(f,
"rc=$?\n");
3441 fprintf(f,
"echo \"rc=$?\"\n");
3442 fprintf(f,
"if [ $? != \"0\" ] ; then\n");
3443 fprintf(f,
" exit 1\n");
3445 fprintf(f,
"exit 0\n");
3451 path.
Form(
"%s/SETUP.C", proofinf);
3453 f = fopen(path.
Data(),
"wb");
3455 f = fopen(path.
Data(),
"w");
3458 Error(
"MakeProjectParProofInf",
"cannot create file '%s' (errno: %d)",
3463 fprintf(f,
"Int_t SETUP()\n");
3467 fprintf(f,
"// The environment variables ROOTPROOFLITE and ROOTPROOFCLIENT can be used to\n");
3468 fprintf(f,
"// adapt the macro to the calling environment\n");
3470 fprintf(f,
"// if (gSystem->Getenv(\"ROOTPROOFLITE\")) {\n");
3471 fprintf(f,
"// Printf(\"event-SETUP: PROOF-Lite node (session has %%s workers)\",\n");
3472 fprintf(f,
"// gSystem->Getenv(\"ROOTPROOFLITE\"));\n");
3473 fprintf(f,
"// } else if (gSystem->Getenv(\"ROOTPROOFCLIENT\")) {\n");
3474 fprintf(f,
"// Printf(\"event-SETUP: PROOF client\");\n");
3475 fprintf(f,
"// } else {\n");
3476 fprintf(f,
"// Printf(\"event-SETUP: standard PROOF node\");\n");
3477 fprintf(f,
"// }\n");
3479 fprintf(f,
" if (gSystem->Load(\"lib%s\") == -1)\n", pack);
3480 fprintf(f,
" return -1;\n");
3481 fprintf(f,
" return 0;\n");
3503 TList *list = listRetcode.fList;
3504 auto retcode = listRetcode.fReturnCode;
3517 if (version > 1000000) version -= 1000000;
3518 if (version < 53419 || (59900 < version && version < 59907)) {
3533 if (!base)
continue;
3545 for (
int mode=0;mode<2; ++mode) {
3558 if (strcmp(obj->
GetName(),
"listOfRules")==0) {
3566 rulelnk = rulelnk->
Next();
3570 Warning(
"ReadStreamerInfo",
"%s has a %s in the list of TStreamerInfo.",
GetName(), info->IsA()->
GetName());
3580 Warning(
"ReadStreamerInfo",
"The StreamerInfo for %s does not have a list of elements.",info->
GetName());
3585 Bool_t isstl = element && strcmp(
"This",element->
GetName())==0;
3587 if ( (!isstl && mode ==0) || (isstl && mode ==1) ) {
3596 printf(
"ReadStreamerInfo, class:%s, illegal uid=%d\n",info->
GetName(),uid);
3662 for (
Int_t i=0;i<npids;i++) {
3670 snprintf(name,32,
"ProcessID%d",npids);
3674 Info(
"WriteProcessID",
"name=%s, file=%s", name,
GetName());
3708 listOfRules.
SetName(
"listOfRules");
3709 std::set<TClass*> classSet;
3713 Int_t uid = info->GetNumber();
3716 if (
gDebug > 0) printf(
" -class: %s info number %d saved\n",info->GetName(),uid);
3721 if (clinfo && clinfo->GetSchemaRules()) {
3722 if ( classSet.find( clinfo ) == classSet.end() ) {
3723 if (
gDebug > 0) printf(
" -class: %s stored the I/O customization rules\n",info->GetName());
3729 rule->AsString(obj->
String());
3730 listOfRules.
Add(obj);
3732 classSet.insert(clinfo);
3743 list.
Add(&listOfRules);
3775 "you want to read through a cache, but you have no valid cache " 3776 "directory set - reading remotely");
3777 ::Info(
"TFile::OpenFromCache",
"set cache directory using TFile::SetCacheFileDir()");
3786 "you want to read through a cache, but you are reading " 3787 "local files - CACHEREAD disabled");
3794 cachefilepath += fileurl.
GetFile();
3798 ::Warning(
"TFile::OpenFromCache",
"you want to read through a cache, but I " 3799 "cannot create the directory %s - CACHEREAD disabled",
3800 cachefilepathbasedir.
Data());
3805 cachefilepath +=
"__";
3809 if (strstr(name,
"zip=")) {
3814 Int_t optioncount = 0;
3823 if (optioncount!=0) {
3828 newoptions += value;
3838 cachefilepath +=
"__";
3839 cachefilepath += zipname;
3853 char cacheblock[256];
3854 char remotblock[256];
3857 cfurl = cachefilepath;
3858 cfurl +=
"?filetype=raw";
3861 ropt +=
"&filetype=raw";
3874 ::Error(
"TFile::OpenFromCache",
3875 "cannot open the cache file to check cache consistency");
3880 ::Error(
"TFile::OpenFromCache",
3881 "cannot open the remote file to check cache consistency");
3888 if ((!cachefile->
ReadBuffer(cacheblock,256)) &&
3890 if (memcmp(cacheblock, remotblock, 256)) {
3891 ::Warning(
"TFile::OpenFromCache",
"the header of the cache file " 3892 "differs from the remote file - forcing an update");
3896 ::Warning(
"TFile::OpenFromCache",
"the header of the cache and/or " 3897 "remote file are not readable - forcing an update");
3911 if (need2copy && !
TFile::Cp(name, cachefilepath)) {
3912 ::Warning(
"TFile::OpenFromCache",
"you want to read through a cache, but I " 3913 "cannot make a cache copy of %s - CACHEREAD disabled",
3914 cachefilepathbasedir.
Data());
3920 ::Info(
"TFile::OpenFromCache",
"using local cache copy of %s [%s]",
3921 name, cachefilepath.
Data());
3924 fileurl.
SetFile(cachefilepath);
3928 tagfile = cachefilepath;
3929 tagfile +=
".ROOT.cachefile";
3985 if (!url || strlen(url) <= 0) {
3986 ::Error(
"TFile::Open",
"no url specified");
3999 TString sto = opts(ito + strlen(
"TIMEOUT="), opts.
Length());
4004 if (
gDebug > 0)
::Info(
"TFile::Open",
"timeout of %d millisec requested", toms);
4006 sto.
Insert(0,
"TIMEOUT=");
4024 ::Info(
"TFile::Open",
"waited %d millisec for asynchronous open", toms - xtms);
4026 ::Info(
"TFile::Open",
"timeout option not supported (requires asynchronous" 4031 ::Error(
"TFile::Open",
"timeout expired while opening '%s'", expandedUrl.
Data());
4038 ::Warning(
"TFile::Open",
"incomplete 'TIMEOUT=' option specification - ignored");
4044 const char *option = opts;
4047 TString namelist(expandedUrl);
4064 while (namelist.
Tokenize(n, from,
"|") && !
f) {
4067 if (!strcasecmp(option,
"CACHEREAD") ||
4090 if (urlOptions.BeginsWith(
"pmerge") || urlOptions.Contains(
"&pmerge") || urlOptions.Contains(
" pmerge")) {
4099 type =
GetType(name, option, &lfname);
4107 lfname = urlname.
GetUrl();
4109 f =
new TFile(lfname.
Data(), option, ftitle, compress);
4111 }
else if (type ==
kNet) {
4114 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TFile", name))) {
4120 }
else if (type ==
kWeb) {
4123 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TFile", name))) {
4129 }
else if (type ==
kFile) {
4132 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TFile", name)) &&
4137 f =
new TFile(name.
Data(), option, ftitle, compress);
4142 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TFile", name.
Data()))) {
4164 f =
TFile::Open( newUrl, option, ftitle, compress );
4218 const char *ftitle,
Int_t compress,
4227 if (!url || strlen(url) <= 0) {
4228 ::Error(
"TFile::AsyncOpen",
"no url specified");
4240 TString outf =
".TFileAsyncOpen_";
4251 while (namelist.
Tokenize(n, from,
"|") && !
f) {
4264 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TFile", name)) &&
4265 (!strcmp(h->
GetClass(),
"TXNetFile") || !strcmp(h->
GetClass(),
"TNetXNGFile"))
4271 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TFile", name)) &&
4283 if (!notfound && !f)
4354 #if defined(R__WINGCC) 4358 #elif defined(R__SEEK64) 4359 return ::open64(pathname, flags, mode);
4370 if (fd < 0)
return 0;
4379 return ::read(fd, buf, len);
4387 return ::write(fd, buf, len);
4398 #if defined (R__SEEK64) 4399 return ::lseek64(fd, offset, whence);
4400 #elif defined(WIN32) 4401 return ::_lseeki64(fd, offset, whence);
4403 return ::lseek(fd, offset, whence);
4430 return ::_commit(fd);
4508 ::Error(
"TFile::SetCacheFileDir",
"no sufficient permissions on cache directory %s or cannot create it",
TString(cachedir).Data());
4550 cachetagfile +=
".tag.ROOT.cache";
4554 if (lastcleanuptime < cleanupinterval) {
4555 ::Info(
"TFile::ShrinkCacheFileDir",
"clean-up is skipped - last cleanup %lu seconds ago - you requested %lu", lastcleanuptime, cleanupinterval);
4561 cachetagfile +=
"?filetype=raw";
4564 if (!(tagfile =
TFile::Open(cachetagfile,
"RECREATE"))) {
4565 ::Error(
"TFile::ShrinkCacheFileDir",
"cannot create the cache tag file %s", cachetagfile.
Data());
4573 #if defined(R__WIN32) 4574 cmd =
"echo <TFile::ShrinkCacheFileDir>: cleanup to be implemented";
4575 #elif defined(R__MACOSX) 4576 cmd.
Format(
"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);
4578 cmd.
Format(
"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);
4585 ::Error(
"TFile::ShrinkCacheFileDir",
"error executing clean-up script");
4697 if (re.
Match(name)) {
4715 forceRemote =
kTRUE;
4716 else if (opts.
Contains(
"remote=0"))
4725 if (fname[0] ==
'/') {
4727 lfname.
Form(
"%s%s", prefix->
Data(), fname);
4730 }
else if (fname[0] ==
'~' || fname[0] ==
'$') {
4748 if (localFile && prefix)
4754 type = (localFile) ?
kLocal : type;
4755 }
else if (
TPMERegexp(
"^(http[s]?|s3http[s]?|[a]?s3|gs|gshttp[s]?){1}:",
"i").
Match(name)) {
4759 }
else if (!strncmp(name,
"file:", 5)) {
4785 if (of && (of->
GetSize() > 0)) {
4788 while ((f = (
TFile *)nxf()))
4802 if (handle && handle->
fFile) {
4832 if (of && (of->
GetSize() > 0)) {
4835 while ((f = (
TFile *)nxf()))
4841 return (
const TUrl *)0;
4849 fprintf(stderr,
"[TFile::Cp] Total %.02f MB\t|", (
Double_t)size/1048576);
4851 for (
int l = 0;
l < 20;
l++) {
4853 if (
l < 20*bytesread/size)
4854 fprintf(stderr,
"=");
4855 else if (
l == 20*bytesread/size)
4856 fprintf(stderr,
">");
4857 else if (
l > 20*bytesread/size)
4858 fprintf(stderr,
".");
4860 fprintf(stderr,
"=");
4866 fprintf(stderr,
"| %.02f %% [%.01f MB/s]\r",
4867 100.0*(size?(bytesread/((
float)size)):1), (lCopy_time>0.)?bytesread/lCopy_time/1048576.:0.);
4891 if (opt !=
"") opt +=
"&";
4900 char *copybuffer = 0;
4902 TFile *sfile =
this;
4919 ::Error(
"TFile::Cp",
"cannot open destination file %s", dst);
4925 rmdestiferror =
kTRUE;
4930 copybuffer =
new char[buffersize];
4932 ::Error(
"TFile::Cp",
"cannot allocate the copy buffer");
4950 if (progressbar)
CpProgress(totalread, filesize,watch);
4955 if (filesize - b1 > (
Long64_t)buffersize) {
4956 readsize = buffersize;
4958 readsize = filesize - b1;
4961 if (readsize == 0)
break;
4967 if ((read <= 0) || readop) {
4968 ::Error(
"TFile::Cp",
"cannot read from source file %s. readsize=%lld read=%lld readop=%d",
4969 sfile->
GetName(), readsize, read, readop);
4976 if ((written != read) || writeop) {
4977 ::Error(
"TFile::Cp",
"cannot write %lld bytes to destination file %s", read, dst);
4981 }
while (read == (
Long64_t)buffersize);
4985 fprintf(stderr,
"\n");
4991 if (dfile) dfile->
Close();
4993 if (dfile)
delete dfile;
4994 if (copybuffer)
delete[] copybuffer;
4996 if (rmdestiferror && (success !=
kTRUE))
5019 if (opt !=
"") opt +=
"&";
5025 opt +=
TString::Format(
"&cachesz=%d&readaheadsz=%d&rmpolicy=1", 4*buffersize, 2*buffersize);
5034 ::Error(
"TFile::Cp",
"cannot open source file %s", src);
5036 success = sfile->
Cp(dst, progressbar, buffersize);
5039 if (sfile) sfile->
Close();
5040 if (sfile)
delete sfile;
5049 #if defined(R__neverLINUX) && !defined(R__WINGCC) 5061 int advice = POSIX_FADV_WILLNEED;
5066 advice = POSIX_FADV_NORMAL;
5070 #if defined(R__SEEK64) 5071 Int_t result = posix_fadvise64(
fD, offset, len, advice);
5073 Int_t result = posix_fadvise(
fD, offset, len, advice);
5078 return (result != 0);
5100 return ((bytes < 0) ? 0 : bytes);
virtual Bool_t SendFileCloseEvent(TFile *)
TDatime fDatimeM
Date and time of last modification.
Describe Streamer information for one class version.
virtual Bool_t SendFileWriteProgress(TFile *)
void SetFile(const char *file)
Long64_t GetRelOffset() const
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
virtual Int_t Sizeof() const
Return the size in bytes of the directory header.
static TProcessID * GetPID()
static: returns pointer to current TProcessID
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Bool_t fIsArchive
!True if this is a pure archive file
static ROOT::TRWSpinLock fgRwLock
!Read-write lock to protect global PID list
virtual const char * GetName() const
Returns name of object.
virtual void SysError(const char *method, const char *msgfmt,...) const
Issue system error message.
Bool_t fIsPcmFile
!True if the file is a ROOT pcm file.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual UInt_t GetUniqueID() const
Return the unique object id.
void frombuf(char *&buf, Bool_t *x)
virtual void DrawMap(const char *keys="*", Option_t *option="")
Draw map of objects in this file.
virtual Int_t Recover()
Attempt to recover file if not correctly closed.
TFileCacheRead * fCacheRead
!Pointer to the read cache (if any)
Char_t fUnits
Number of bytes for file pointers.
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
const char * GetArchiveName() const
virtual Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime)
Return file stat information.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
TObjArray * fProcessIDs
!Array of pointers to TProcessIDs
virtual const char * GetFlagsOpt() const
Return the optimization flags.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Long64_t fBEGIN
First used byte in file.
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
ROOT::ESTLType IsSTLCont(std::string_view type)
type : type name: vector<list<classA,allocator>,allocator> result: 0 : not stl container code of cont...
void Set(Int_t n)
Set size of this array to n chars.
static Bool_t AddRule(const char *rule)
Add a schema evolution customization rule.
virtual Bool_t IsPathLocal(const char *path)
Returns TRUE if the url in 'path' points to the local file system.
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
static Bool_t fgReadInfo
if true (default) ReadStreamerInfo is called when opening a file
virtual Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence)
Interface to system lseek.
Long64_t GetMemberFilePosition() const
Return position in archive of current member.
Long64_t fBytesWrite
Number of bytes written to this file.
EAsyncOpenStatus
Asynchronous open request status.
virtual const char * WorkingDirectory()
Return working directory.
Long64_t fSeekParent
Location of parent directory on file.
void SetProtocol(const char *proto, Bool_t setDefaultPort=kFALSE)
Set protocol and, optionally, change the port accordingly.
virtual void FillBuffer(char *&buffer)
Encode file output buffer.
Double_t fSumBuffer
Sum of buffer sizes of objects written so far.
static std::atomic< Long64_t > fgBytesRead
Number of bytes read by all TFile objects.
Collectable string class.
Long64_t fSeekKeys
Location of Keys record on file.
virtual Int_t ReOpen(Option_t *mode)
Reopen a file with a different access mode.
Int_t fCompress
Compression level and algorithm.
TArrayC * fClassIndex
!Index of TStreamerInfo classes written to this file
Bool_t Matches(const char *name)
Return kTRUE if this async request matches the open request specified by 'url'.
static void IncrementFileCounter()
virtual void ReadFree()
Read the FREE linked list.
A cache when reading files over the network.
virtual void Save()
Save recursively all directory keys and headers.
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.
virtual void Flush()
Synchronize a file's in-memory and on-disk states.
virtual void SetCacheRead(TFileCacheRead *cache, TObject *tree=0, ECacheAction action=kDisconnect)
Set a pointer to the read cache.
static TList * fgAsyncOpenRequests
virtual void SetOffset(Long64_t offset, ERelativeTo pos=kBeg)
Set position from where to start reading.
This class represents a WWW compatible URL.
virtual char * GetBuffer() const
TString & ReplaceAll(const TString &s1, const TString &s2)
virtual void RemoveLast()
Remove the last object of the list.
virtual TKey * CreateKey(TDirectory *mother, const TObject *obj, const char *name, Int_t bufsize)
Creates key for object and converts data to buffer.
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.
Class holding info about the file being opened.
const char * GetProtocol() const
static UInt_t fgOpenTimeout
Timeout for open operations in ms - 0 corresponds to blocking i/o.
virtual const char * GetClassName() const
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual void Seek(Long64_t offset, ERelativeTo pos=kBeg)
Seek to a specific position in the file. Pos it either kBeg, kCur or kEnd.
TObjArray * GetListOfProcessIDs() const
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
static void SetFileReadCalls(Int_t readcalls=0)
virtual Int_t GetEntries() const
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.
static Bool_t SetCacheFileDir(ROOT::Internal::TStringView cacheDir, Bool_t operateDisconnected=kTRUE, Bool_t forceCacheread=kFALSE)
virtual const char * HomeDirectory(const char *userName=0)
Return the user's home directory.
void ReadBuffer(char *&buffer)
Stream UUID from input buffer.
void ToUpper()
Change string to upper case.
Buffer base class used for serializing objects.
Bool_t HasInterpreterInfo() const
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
const char * GetFileAndOptions() const
Return the file and its options (the string specified behind the ?).
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection)...
static TArchiveFile * Open(const char *url, TFile *file)
Return proper archive file handler depending on passed url.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual Long64_t GetBytesWritten() const
Return the total number of bytes written so far to the file.
Int_t LoadPlugin()
Load the plugin library for this handler.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
static Bool_t ShrinkCacheFileDir(Long64_t shrinkSize, Long_t cleanupInteval=0)
Try to shrink the cache to the desired size.
virtual Int_t Sizeof() const
Return size of the TNamed part of the TObject.
void ToLower()
Change string to lower-case.
virtual void FillBuffer(char *&buffer)
Encode TNamed into output buffer.
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
Iterator of object array.
R__EXTERN TVirtualMutex * gROOTMutex
Int_t WriteBufferViaCache(const char *buf, Int_t len)
Write buffer via cache.
virtual const char * GetSoExt() const
Get the shared library extension.
const char * GetOptions() 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...
TArchiveMember * GetMember() const
Long64_t fBytesReadExtra
Number of extra bytes (overhead) read by the readahead 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 const char * GetFlagsDebug() const
Return the debug flags.
TList * fInfoCache
!Cached list of the streamer infos in this file
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
virtual TList * GetStreamerInfoList() final
Read the list of TStreamerInfo objects written to this file.
TObject * At(Int_t idx) const
virtual void IgnoreInterrupt(Bool_t ignore=kTRUE)
If ignore is true ignore the interrupt signal, else restore previous behaviour.
static void SetReadStreamerInfo(Bool_t readinfo=kTRUE)
Specify if the streamerinfos must be read at file opening.
Long64_t fSeekInfo
Location on disk of StreamerInfo record.
Int_t fReadCalls
Number of read calls ( not counting the cache calls )
This class is a TS set of unsigned set.
TArchiveFile * fArchive
!Archive file from which we read this file
void ReadBuffer(char *&buffer)
Decode Date/Time from output buffer, used by I/O system.
virtual TObject * Clone(const char *newname="") const
Make a clone of an collection using the Streamer facility.
static void SetReadaheadSize(Int_t bufsize=256000)
TString & Insert(Ssiz_t pos, const char *s)
virtual Int_t GetBytesInCache() const
virtual Int_t GetNkeys() const
virtual void FillBuffer(char *&buffer)
Encode directory header into output buffer.
R__EXTERN void **(* gThreadTsd)(void *, Int_t)
const char * GetHostFQDN() const
Return fully qualified domain name of url host.
virtual int mkdir(const char *name, Bool_t recursive=kFALSE)
Make a file system directory.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
virtual TObject * FindObject(const char *name) const
Delete a TObjLink object.
void SumBuffer(Int_t bufsize)
Increment statistics for buffer sizes of objects in this file.
if object in a list can be deleted
virtual void FillBuffer(char *&buffer)
Encode fre structure into output buffer.
static Int_t GetErrno()
Static function returning system error number.