79 #define _XOPEN_SOURCE 600
90 # include <sys/types.h>
94 #include "Compression.h"
96 #include "RConfigure.h"
100 #include "TClassEdit.h"
128 #include "compiledata.h"
161 static struct AddPseudoGlobals {
187 fCacheReadMap =
new TMap();
200 fAsyncOpenStatus = kAOSNotAsync;
201 SetBit(kBinaryFile,
kTRUE);
217 Info(
"TFile",
"default ctor");
326 ::Fatal(
"TFile::TFile",
"ROOT system not initialized");
334 fNoAnchorInName =
kTRUE;
341 fname1 = fUrl.GetFile();
345 if (strstr(fUrl.GetOptions(),
"filetype=raw"))
350 if (strstr(fUrl.GetOptions(),
"filetype=pcm"))
359 fAsyncOpenStatus = kAOSNotAsync;
365 fVersion =
gROOT->GetVersionInt();
368 fCompress = compress;
382 fCacheReadMap =
new TMap();
385 SetBit(kBinaryFile,
kTRUE);
392 if (fIsRootFile && !fIsPcmFile && fOption !=
"NEW" && fOption !=
"CREATE"
393 && fOption !=
"RECREATE") {
401 if (!strlen(fArchive->GetMemberName()))
406 if (fOption ==
"NET")
409 if (fOption ==
"WEB") {
415 if (fOption ==
"NEW")
422 if (!create && !recreate && !update && !read) {
429 if (!fname1 || !fname1[0]) {
430 Error(
"TFile",
"file name is not specified");
435 if (!strcmp(fname1,
"/dev/null") &&
451 fname = fRealName.Data();
453 Error(
"TFile",
"error expanding path %s", fname1);
460 SysError(
"TFile",
"could not delete %s (errno: %d)",
470 Error(
"TFile",
"file %s already exists", fname);
479 Error(
"TFile",
"no write permission, could not open file %s", fname);
485 Error(
"TFile",
"file %s does not exist", fname);
489 Error(
"TFile",
"no read permission, could not open file %s", fname);
495 if (create || update) {
497 fD = SysOpen(fname, O_RDWR | O_CREAT, 0644);
499 fD = SysOpen(fname, O_RDWR | O_CREAT |
O_BINARY, S_IREAD | S_IWRITE);
502 SysError(
"TFile",
"file %s can not be opened", fname);
508 fD = SysOpen(fname, O_RDONLY, 0644);
510 fD = SysOpen(fname, O_RDONLY |
O_BINARY, S_IREAD | S_IWRITE);
513 SysError(
"TFile",
"file %s can not be opened for reading", fname);
527 gROOT->GetListOfClosedObjects()->Add(
this);
538 MayNotUse(
"TFile::TFile(const TFile &)");
560 gROOT->GetListOfClosedObjects()->Remove(
this);
597 Error(
"Init",
"archive %s can only be opened in read mode",
GetName());
616 Error(
"Init",
"member %s not found in archive %s",
654 char *header =
new char[
kBEGIN+200];
659 Error(
"Init",
"%s failed to read the file type data.",
666 if (strncmp(header,
"root", 4)) {
672 char *buffer = header + 4;
675 frombuf(buffer, &headerLength);
678 Int_t send,sfree,sinfo;
699 if (fBEGIN < 0 || fBEGIN >
fEND) {
701 Error(
"Init",
"file %s has an incorrect header length (%lld) or incorrect end of file length (%lld)",
712 Warning(
"Init",
"file %s probably not closed, cannot read free segments",
GetName());
717 char *buffer_keyloc = 0;
720 if ( (nbytes +
fBEGIN) > fEND) {
722 Error(
"Init",
"file %s has an incorrect header length (%lld) or incorrect end of file length (%lld)",
728 header =
new char[nbytes];
733 Error(
"Init",
"%s failed to read the file header information at %lld (size=%d)",
739 buffer_keyloc = header;
742 buffer_keyloc = header+
fBEGIN;
745 frombuf(buffer,&version); versiondir = version%1000;
750 if (version > 1000) {
755 Int_t sdir,sparent,skeys;
763 buffer_keyloc +=
sizeof(
Int_t);
765 frombuf(buffer_keyloc, &keyversion);
767 if (keyversion > 1000) {
778 if (fNbytesName < 10 || fNbytesName > 10000) {
779 Error(
"Init",
"cannot read directory info of file %s",
GetName());
785 if ((size =
GetSize()) == -1) {
807 }
else if ((
fBEGIN+nbytes == fEND) && (fEND == size)) {
815 Error(
"Init",
"file %s is truncated at %lld bytes: should be %lld, "
816 "trying to recover",
GetName(), size, fEND);
818 Error(
"Init",
"file %s is truncated at %lld bytes: should be %lld",
824 Warning(
"Init",
"file %s probably not closed, "
825 "trying to recover",
GetName());
833 Warning(
"Init",
"successfully recovered %d keys", nrecov);
835 Warning(
"Init",
"no keys recovered, file has been made a Zombie");
843 gROOT->GetListOfFiles()->Add(
this);
849 Int_t lenIndex =
gROOT->GetListOfStreamerInfo()->GetSize()+1;
850 if (lenIndex < 5000) lenIndex = 5000;
857 gROOT->GetListOfFiles()->Remove(
this);
863 Warning(
"Init",
"no StreamerInfo found in %s therefore preventing schema evolution when reading this file.",
GetName());
873 while ((key = (
TKey*)next())) {
883 gROOT->GetListOfClosedObjects()->Add(
this);
931 while ((key = iter()) != 0) {
989 gROOT->GetListOfFiles()->Remove(
this);
990 gROOT->GetListOfBrowsers()->RecursiveRemove(
this);
991 gROOT->GetListOfClosedObjects()->Add(
this);
1002 return new TKey(obj, name, bufsize, mother);
1010 return new TKey(obj, cl, name, bufsize, mother);
1022 static TFile *currentFile = 0;
1054 Info(
"Delete",
"deleting name = %s", namecycle);
1075 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TFileDrawMap"))) {
1116 Version_t version = TFile::Class_Version();
1117 tobuf(buffer, version);
1145 Int_t nbytes, objlen, nwh = 64;
1146 char *header =
new char[
fBEGIN];
1152 while (idcur <
fEND-100) {
1167 if (nbytes == 0)
break;
1173 if (!objlen) objlen = nbytes-keylen;
1175 uncomp += keylen + objlen;
1243 if (first <
fBEGIN)
return 0;
1244 if (first >
fEND)
return 0;
1246 Int_t nread = maxbytes;
1247 if (first+maxbytes >
fEND) nread =
fEND-maxbytes;
1249 Warning(
"GetRecordHeader",
"%s: parameter maxbytes = %d must be >= 4",
1255 Warning(
"GetRecordHeader",
"%s: failed to read header data (maxbytes = %d)",
1266 if (nb < 0)
return nread;
1268 const Int_t headerSize = 16;
1269 if (nread < headerSize)
return nread;
1274 if (!olen) olen = nbytes-klen;
1292 if (const_cast<TFile*>(
this)->
SysStat(
fD, &
id, &size, &flags, &modtime)) {
1293 Error(
"GetSize",
"cannot stat the file %s",
GetName());
1341 Warning(
"GetRecordHeader",
"%s: failed to read the StreamerInfo data from disk.",
1351 list = (
TList*)
Get(
"StreamerInfo");
1355 Info(
"GetStreamerInfoList",
"cannot find the StreamerInfo record in file %s",
1402 if(!newfree)
return;
1406 if (nbytesl > 2000000000) nbytesl = 2000000000;
1409 char * buffer =
new char[nb];
1410 char * psave = buffer;
1411 tobuf(buffer, nbytes);
1461 Int_t nbytes,date,time,objlen,nwheader;
1470 Int_t nread = nwheader;
1473 char classname[512];
1475 while (idcur <
fEND) {
1477 if (idcur+nread >=
fEND) nread =
fEND-idcur-1;
1480 Warning(
"Map",
"%s: failed to read the key data from disk at %lld.",
1488 Printf(
"Address = %lld\tNbytes = %d\t=====E R R O R=======", idcur, nbytes);
1493 Printf(
"Address = %lld\tNbytes = %d\t=====G A P===========", idcur, nbytes);
1504 if (versionkey > 1000) {
1513 for (
int i = 0;i < nwhc; i++)
frombuf(buffer, &classname[i]);
1514 classname[(int)nwhc] =
'\0';
1515 if (idcur ==
fSeekFree) strlcpy(classname,
"FreeSegments",512);
1516 if (idcur ==
fSeekInfo) strlcpy(classname,
"StreamerInfo",512);
1517 if (idcur ==
fSeekKeys) strlcpy(classname,
"KeysList",512);
1519 if (objlen != nbytes-keylen) {
1521 Printf(
"%d/%06d At:%lld N=%-8d %-14s CX = %5.2f",date,time,idcur,nbytes,classname,cx);
1523 Printf(
"%d/%06d At:%lld N=%-8d %-14s",date,time,idcur,nbytes,classname);
1527 Printf(
"%d/%06d At:%lld N=%-8d %-14s",date,time,idcur,1,
"END");
1582 Error(
"ReadBuffer",
"error reading all requested bytes from file %s, got %ld of %d",
1629 Error(
"ReadBuffer",
"error reading all requested bytes from file %s, got %ld of %d",
1660 for (
Int_t j = 0; j < nbuf; j++) {
1677 cur = pos[i]+len[i];
1680 if (bigRead || (i>=nbuf)) {
1694 Long64_t nahead = pos[i-1]+len[i-1]-curbegin;
1699 for (
Int_t j=0;j<
n;j++) {
1700 memcpy(&buf[k],&buf2[pos[i-n+j]-curbegin],len[i-n+j]);
1713 if (buf2)
delete [] buf2;
1763 if (fNbytesFree < 0 || fNbytesFree >
fEND) {
1799 snprintf(pidname,32,
"ProcessID%d",pidf);
1802 printf(
"ReadProcessID, name=%s, file=%s, pid=%lx\n",pidname,
GetName(),(
Long_t)pid);
1811 TIter next(pidslist);
1884 Int_t nbytes,date,time,objlen,nwheader;
1887 char *buffer, *bufread;
1892 if ((size =
GetSize()) == -1) {
1893 Error(
"Recover",
"cannot stat the file %s",
GetName());
1904 Int_t nread = nwheader;
1906 while (idcur <
fEND) {
1908 if (idcur+nread >=
fEND) nread =
fEND-idcur-1;
1911 Error(
"Recover",
"%s: failed to read the key data from disk at %lld.",
1919 Error(
"Recover",
"Address = %lld\tNbytes = %d\t=====E R R O R=======", idcur, nbytes);
1934 if (versionkey > 1000) {
1943 char *classname = 0;
1944 if (nwhc <= 0 || nwhc > 100)
break;
1945 classname =
new char[nwhc+1];
1946 int i, nwhci = nwhc;
1947 for (i = 0;i < nwhc; i++)
frombuf(buffer, &classname[i]);
1948 classname[nwhci] =
'\0';
1952 && strcmp(classname,
"TBasket")) {
1953 key =
new TKey(
this);
1955 if (!strcmp(key->
GetName(),
"StreamerInfo")) {
1966 delete [] classname;
1971 if (max_file_size <
fEND) max_file_size =
fEND+1000000000;
1978 if (nrecov)
Write();
2001 if (opt !=
"READ" && opt !=
"UPDATE") {
2002 Error(
"ReOpen",
"mode must be either READ or UPDATE, not %s", opt.
Data());
2009 if (opt ==
"READ") {
2047 SysError(
"ReOpen",
"file %s can not be opened in read mode",
GetName());
2069 SysError(
"ReOpen",
"file %s can not be opened in update mode",
GetName());
2078 Warning(
"ReOpen",
"file %s probably not closed, cannot read free segments",
GetName());
2099 Error(
"SetOffset",
"seeking from end in archive is not (yet) supported");
2123 Error(
"Seek",
"seeking from end in archive is not (yet) supported");
2127 if ((retpos =
SysSeek(
fD, offset, whence)) < 0)
2128 SysError(
"Seek",
"cannot seek to position %lld in file %s, retpos=%lld",
2141 if (algorithm < 0 || algorithm >= ROOT::kUndefinedCompressionAlgorithm) algorithm = 0;
2156 if (level < 0) level = 0;
2157 if (level > 99) level = 99;
2163 if (algorithm >= ROOT::kUndefinedCompressionAlgorithm) algorithm = 0;
2212 if (cache) cache->
SetFile(
this, action);
2303 Error(
"Write const",
"A const TFile object should not be saved. We try to proceed anyway.");
2304 return const_cast<TFile*
>(
this)->
Write(n, opt, bufsize);
2335 Error(
"WriteBuffer",
"error writing all requested bytes to file %s, wrote %ld of %d",
2362 Error(
"WriteBuffer",
"error writing to cache");
2387 auto createKey = [
this]() {
2391 while ((afree = (
TFree*) next())) {
2392 nbytes += afree->
Sizeof();
2394 if (!nbytes)
return (
TKey*)
nullptr;
2400 return (
TKey*)
nullptr;
2405 TKey *key = createKey();
2422 char *start = buffer;
2426 while ((afree = (
TFree*) next())) {
2431 auto actualBytes = buffer-start;
2432 if ( actualBytes != nbytes ) {
2433 if (actualBytes < nbytes) {
2436 memset(buffer,0,nbytes-actualBytes);
2438 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);
2455 const char *root =
"root";
2456 char *psave =
new char[
fBEGIN];
2457 char *buffer = psave;
2459 memcpy(buffer, root, 4); buffer += 4;
2462 tobuf(buffer, version);
2464 if (version < 1000000) {
2468 tobuf(buffer, nfree);
2478 tobuf(buffer, nfree);
2486 Int_t nbytes = buffer - psave;
2577 path +=
"/PROOF-INF";
2579 const char *afile = 0;
2582 if (strcmp(afile,
".") == 0)
continue;
2583 if (strcmp(afile,
"..") == 0)
continue;
2584 filepath.
Form(
"%s/%s", path.
Data(), afile);
2586 Warning(
"MakeProject",
"1: problems unlinking '%s' ('%s', '%s')", filepath.
Data(), path.
Data(), afile);
2593 if (strcmp(afile,
".") == 0)
continue;
2594 if (strcmp(afile,
"..") == 0)
continue;
2595 filepath.
Form(
"%s/%s", path.
Data(), afile);
2597 Warning(
"MakeProject",
"2: problems unlinking '%s' ('%s', '%s')", filepath.
Data(), path.
Data(), afile);
2601 Warning(
"MakeProject",
"problems unlinking '%s'", path.
Data());
2605 path.
Form(
"%s/%s/PROOF-INF", pardir.
Data(), parname.
Data());
2607 Error(
"MakeProject",
"problems creating '%s'", path.
Data());
2622 }
else if (opt.
Contains(
"recreate")) {
2626 Error(
"MakeProject",
"cannot create directory '%s'",dirname);
2633 if (afile == 0)
break;
2634 if (strcmp(afile,
".") == 0)
continue;
2635 if (strcmp(afile,
"..") == 0)
continue;
2636 dirpath.
Form(
"%s/%s",dirname,afile);
2644 Error(
"MakeProject",
"cannot create directory %s, already existing",dirname);
2649 Error(
"MakeProject",
"cannot create directory '%s'",dirname);
2662 if (filelist) filelist = (
TList*)filelist->
Clone();
2663 if (filelist == 0) {
2664 Error(
"MakeProject",
"file %s has no StreamerInfo",
GetName());
2668 TString clean_dirname(dirname);
2669 if (makepar) clean_dirname.
Form(
"%s/%s", pardir.
Data(), parname.
Data());
2670 if (clean_dirname[clean_dirname.
Length()-1]==
'/') {
2672 }
else if (clean_dirname[clean_dirname.
Length()-1]==
'\\') {
2674 if (clean_dirname[clean_dirname.
Length()-1]==
'\\') {
2679 if (makepar) subdirname = parname;
2680 if (subdirname ==
"") {
2681 Error(
"MakeProject",
"Directory name must not be empty.");
2686 TString spath; spath.
Form(
"%s/%sProjectSource.cxx",clean_dirname.
Data(),subdirname.Data());
2687 FILE *sfp = fopen(spath.
Data(),
"w");
2689 Error(
"MakeProject",
"Unable to create the source file %s.",spath.
Data());
2692 fprintf(sfp,
"namespace std {}\nusing namespace std;\n");
2693 fprintf(sfp,
"#include \"%sProjectHeaders.h\"\n\n",subdirname.Data() );
2694 if (!genreflex) fprintf(sfp,
"#include \"%sLinkDef.h\"\n\n",subdirname.Data() );
2695 fprintf(sfp,
"#include \"%sProjectDict.cxx\"\n\n",subdirname.Data() );
2696 fprintf(sfp,
"struct DeleteObjectFunctor {\n");
2697 fprintf(sfp,
" template <typename T>\n");
2698 fprintf(sfp,
" void operator()(const T *ptr) const {\n");
2699 fprintf(sfp,
" delete ptr;\n");
2700 fprintf(sfp,
" }\n");
2701 fprintf(sfp,
" template <typename T, typename Q>\n");
2702 fprintf(sfp,
" void operator()(const std::pair<T,Q> &) const {\n");
2703 fprintf(sfp,
" // Do nothing\n");
2704 fprintf(sfp,
" }\n");
2705 fprintf(sfp,
" template <typename T, typename Q>\n");
2706 fprintf(sfp,
" void operator()(const std::pair<T,Q*> &ptr) const {\n");
2707 fprintf(sfp,
" delete ptr.second;\n");
2708 fprintf(sfp,
" }\n");
2709 fprintf(sfp,
" template <typename T, typename Q>\n");
2710 fprintf(sfp,
" void operator()(const std::pair<T*,Q> &ptr) const {\n");
2711 fprintf(sfp,
" delete ptr.first;\n");
2712 fprintf(sfp,
" }\n");
2713 fprintf(sfp,
" template <typename T, typename Q>\n");
2714 fprintf(sfp,
" void operator()(const std::pair<T*,Q*> &ptr) const {\n");
2715 fprintf(sfp,
" delete ptr.first;\n");
2716 fprintf(sfp,
" delete ptr.second;\n");
2717 fprintf(sfp,
" }\n");
2718 fprintf(sfp,
"};\n\n");
2725 TIter flnext(filelist);
2732 if (strstr(info->
GetName(),
"@@")) {
2749 for(
auto rule : rules) {
2750 if( rule->IsRenameRule() || rule->IsAliasRule() )
2753 if ( rule->HasTarget( el->GetName()) && rule->GetAttributes()[0] != 0 ) {
2754 TString attr( rule->GetAttributes() );
2756 if (attr.Contains(
"owner")) {
2757 if (attr.Contains(
"notowner")) {
2780 TIter nextextra(&extrainfos);
2783 filelist->
Add(info);
2794 TIter subnext(list);
2806 if ( (sublen > len) && subinfo->
GetName()[len+1]==
':'
2809 subClasses.
Add(subinfo);
2814 subClasses.
Clear(
"nodelete");
2817 path.
Form(
"%s/%sProjectHeaders.h",clean_dirname.
Data(),subdirname.Data());
2818 FILE *allfp = fopen(path,
"a");
2820 Error(
"MakeProject",
"Cannot open output file:%s\n",path.
Data());
2822 fprintf(allfp,
"#include \"%sProjectInstances.h\"\n", subdirname.Data());
2826 printf(
"MakeProject has generated %d classes in %s\n",ngener,clean_dirname.
Data());
2829 if (!opt.
Contains(
"+") && !makepar) {
2842 path.
Form(
"%s/makep.cmd",clean_dirname.
Data());
2844 path.
Form(
"%s/MAKEP",clean_dirname.
Data());
2847 fpMAKE = fopen(path,
"wb");
2849 fpMAKE = fopen(path,
"w");
2852 Error(
"MakeProject",
"cannot open file %s", path.
Data());
2862 path.
Form(
"%s/%sProjectInstances.h",clean_dirname.
Data(),subdirname.Data());
2864 ifp = fopen(path,
"wb");
2866 ifp = fopen(path,
"w");
2869 Error(
"MakeProject",
"cannot open path file %s", path.
Data());
2879 fprintf(fpMAKE,
"genreflex %sProjectHeaders.h -o %sProjectDict.cxx --comments --iocomments %s ",subdirname.Data(),subdirname.Data(),
gSystem->
GetIncludePath());
2880 path.
Form(
"%s/%sSelection.xml",clean_dirname.
Data(),subdirname.Data());
2883 path.
Form(
"%s/%sLinkDef.h",clean_dirname.
Data(),subdirname.Data());
2886 path.
Form(
"%s/%sLinkDef.h",clean_dirname.
Data(),subdirname.Data());
2892 FILE *fp = fopen(path,
"wb");
2894 FILE *fp = fopen(path,
"w");
2897 Error(
"MakeProject",
"cannot open path file %s", path.
Data());
2906 fprintf(fp,
"<lcgdict>\n");
2909 fprintf(fp,
"#ifdef __CINT__\n");
2927 for(
auto rule : rules) {
2930 rule->AsString(strrule,
"x");
2933 selections.
Append(strrule);
2936 rule->AsString(strrule);
2937 if (strncmp(strrule.
Data(),
"type=",5)==0) {
2940 fprintf(fp,
"#pragma %s;\n",strrule.
Data());
2947 std::vector<std::string> inside;
2949 TClassEdit::GetSplit( info->
GetName(), inside, nestedLoc, TClassEdit::kLong64 );
2950 Int_t stlkind = TClassEdit::STLKind(inside[0].c_str());
2954 switch ( stlkind ) {
2956 case ROOT::kSTLmultimap:
2958 what =
"std::pair<";
2962 if (what[what.
Length()-1]==
'>') {
2968 tmp.
Form(
"<class name=\"%s\" />\n",what.
Data());
2972 tmp.
Form(
"template class %s;\n",what.
Data());
2980 fprintf(fp,
"#pragma link C++ class %s+;\n",what.
Data());
2986 if (strncmp(key->
GetName(),
"pair<",strlen(
"pair<"))==0) {
2988 tmp.
Form(
"<class name=\"%s\" />\n",key->
GetName());
2998 fprintf(fp,
"#pragma link C++ class %s+;\n",key->
GetName());
3009 tmp.
Form(
"<class name=\"%s\" />\n",what.Data());
3013 if (what[what.Length()-1] ==
'>') {
3014 tmp.
Form(
"template class %s;\n",what.Data());
3021 fprintf(fp,
"#pragma link C++ class %s+;\n",what.Data());
3029 if (element->GetClass() && !element->GetClass()->IsLoaded() && element->GetClass()->GetCollectionProxy()) {
3031 tmp.
Form(
"<class name=\"%s\" />\n",what.
Data());
3035 tmp.
Form(
"template class %s;\n",what.
Data());
3044 fprintf(ifp,
"#ifndef PROJECT_INSTANCES_H\n");
3045 fprintf(ifp,
"#define PROJECT_INSTANCES_H\n");
3046 fprintf(ifp,
"%s",instances.
Data());
3047 fprintf(ifp,
"#endif\n");
3048 fprintf(fp,
"%s",selections.
Data());
3049 fprintf(fp,
"</lcgdict>\n");
3051 fprintf(fp,
"#endif\n");
3072 TString rootbuild = ROOTBUILD;
3081 fprintf(fpMAKE,
"-s %sSelection.xml \n",subdirname.Data());
3083 fprintf(fpMAKE,
"%sProjectHeaders.h ",subdirname.Data());
3084 fprintf(fpMAKE,
"%sLinkDef.h \n",subdirname.Data());
3087 fprintf(fpMAKE,
"%s\n",cmd.
Data());
3089 printf(
"%s/MAKEP file has been generated\n", clean_dirname.
Data());
3098 Error(
"MakeProject",
"problems creating PAR make file '%s'", filemake.
Data());
3107 Warning(
"MakeProject",
"problems expanding '%s'", mkarchsrc.
Data());
3110 Error(
"MakeProject",
"problems retrieving '%s' to '%s'", mkarchsrc.
Data(), mkarchdst.
Data());
3119 Error(
"MakeProject",
"problems creating BUILD.sh and/or SETUP.C under '%s'", proofinf.
Data());
3132 chmod(cmod.
Data(), 00700);
3134 Printf(
"Files Makefile, Makefile.arch, PROOF-INF/BUILD.sh and"
3135 " PROOF-INF/SETUP.C have been generated under '%s'", clean_dirname.
Data());
3144 Info(
"MakeProject",
"PAR file %s.par generated", clean_dirname.
Data());
3146 Warning(
"MakeProject",
"problems changing directory back to '%s'", curdir.Data());
3149 Error(
"MakeProject",
"problems changing directory to '%s' - skipping PAR file generation", pardir.
Data());
3152 Warning(
"MakeProject",
"on Windows systems the PAR file cannot be generated out of the package directory!");
3157 if (!makepar && !opt.
Contains(
"nocompilation")) {
3166 chmod(
"makep.cmd",00700);
3171 if (res) printf(
"Shared lib %s has been generated\n",path.
Data());
3176 if (res) printf(
"Shared lib %s has been dynamically linked\n",path.
Data());
3180 extrainfos.
Clear(
"nodelete");
3196 if (!filemake || (filemake && strlen(filemake) <= 0)) {
3197 Error(
"MakeProjectParMake",
"path for output file undefined!");
3202 if (!pack || (pack && strlen(pack) <= 0)) {
3203 Error(
"MakeProjectParMake",
"package name undefined!");
3208 FILE *fmk = fopen(filemake,
"wb");
3210 FILE *fmk = fopen(filemake,
"w");
3218 fprintf(fmk,
"# Makefile for the ROOT test programs.\n");
3219 fprintf(fmk,
"# This Makefile shows how to compile and link applications\n");
3220 fprintf(fmk,
"# using the ROOT libraries on all supported platforms.\n");
3221 fprintf(fmk,
"#\n");
3222 fprintf(fmk,
"# Copyright (c) 2000 Rene Brun and Fons Rademakers\n");
3223 fprintf(fmk,
"#\n");
3224 fprintf(fmk,
"# Author: this makefile has been automatically generated via TFile::MakeProject\n");
3226 fprintf(fmk,
"include Makefile.arch\n");
3228 fprintf(fmk,
"#------------------------------------------------------------------------------\n");
3230 fprintf(fmk,
"PACKO = %sProjectSource.$(ObjSuf)\n", pack);
3231 fprintf(fmk,
"PACKS = %sProjectSource.$(SrcSuf) %sProjectDict.$(SrcSuf)\n", pack, pack);
3232 fprintf(fmk,
"PACKSO = lib%s.$(DllSuf)\n", pack);
3234 fprintf(fmk,
"ifeq ($(PLATFORM),win32)\n");
3235 fprintf(fmk,
"PACKLIB = lib%s.lib\n", pack);
3236 fprintf(fmk,
"else\n");
3237 fprintf(fmk,
"PACKLIB = $(PACKSO)\n");
3238 fprintf(fmk,
"endif\n");
3240 fprintf(fmk,
"OBJS = $(PACKO)\n");
3242 fprintf(fmk,
"PROGRAMS =\n");
3244 fprintf(fmk,
"#------------------------------------------------------------------------------\n");
3246 fprintf(fmk,
".SUFFIXES: .$(SrcSuf) .$(ObjSuf) .$(DllSuf)\n");
3248 fprintf(fmk,
"all: $(PACKLIB)\n");
3250 fprintf(fmk,
"$(PACKSO): $(PACKO)\n");
3251 fprintf(fmk,
"ifeq ($(ARCH),aix)\n");
3252 fprintf(fmk,
"\t\t/usr/ibmcxx/bin/makeC++SharedLib $(OutPutOpt) $@ $(LIBS) -p 0 $^\n");
3253 fprintf(fmk,
"else\n");
3254 fprintf(fmk,
"ifeq ($(ARCH),aix5)\n");
3255 fprintf(fmk,
"\t\t/usr/vacpp/bin/makeC++SharedLib $(OutPutOpt) $@ $(LIBS) -p 0 $^\n");
3256 fprintf(fmk,
"else\n");
3257 fprintf(fmk,
"ifeq ($(PLATFORM),macosx)\n");
3258 fprintf(fmk,
"# We need to make both the .dylib and the .so\n");
3259 fprintf(fmk,
"\t\t$(LD) $(SOFLAGS)$@ $(LDFLAGS) $^ $(OutPutOpt) $@ $(LIBS)\n");
3260 fprintf(fmk,
"ifneq ($(subst $(MACOSX_MINOR),,1234),1234)\n");
3261 fprintf(fmk,
"ifeq ($(MACOSX_MINOR),4)\n");
3262 fprintf(fmk,
"\t\tln -sf $@ $(subst .$(DllSuf),.so,$@)\n");
3263 fprintf(fmk,
"else\n");
3264 fprintf(fmk,
"\t\t$(LD) -bundle -undefined $(UNDEFOPT) $(LDFLAGS) $^ \\\n");
3265 fprintf(fmk,
"\t\t $(OutPutOpt) $(subst .$(DllSuf),.so,$@)\n");
3266 fprintf(fmk,
"endif\n");
3267 fprintf(fmk,
"endif\n");
3268 fprintf(fmk,
"else\n");
3269 fprintf(fmk,
"ifeq ($(PLATFORM),win32)\n");
3270 fprintf(fmk,
"\t\tbindexplib $* $^ > $*.def\n");
3271 fprintf(fmk,
"\t\tlib -nologo -MACHINE:IX86 $^ -def:$*.def \\\n");
3272 fprintf(fmk,
"\t\t $(OutPutOpt)$(PACKLIB)\n");
3273 fprintf(fmk,
"\t\t$(LD) $(SOFLAGS) $(LDFLAGS) $^ $*.exp $(LIBS) \\\n");
3274 fprintf(fmk,
"\t\t $(OutPutOpt)$@\n");
3275 fprintf(fmk,
"else\n");
3276 fprintf(fmk,
"\t\t$(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(LIBS) $(EXPLLINKLIBS)\n");
3277 fprintf(fmk,
"endif\n");
3278 fprintf(fmk,
"endif\n");
3279 fprintf(fmk,
"endif\n");
3280 fprintf(fmk,
"endif\n");
3281 fprintf(fmk,
"\t\t@echo \"$@ done\"\n");
3283 fprintf(fmk,
"clean:\n");
3284 fprintf(fmk,
"\t\t@rm -f $(OBJS) core\n");
3286 fprintf(fmk,
"distclean: clean\n");
3287 fprintf(fmk,
"\t\t@rm -f $(PROGRAMS) $(PACKSO) $(PACKLIB) *Dict.* *.def *.exp \\\n");
3288 fprintf(fmk,
"\t\t *.so *.lib *.dll *.d *.log .def so_locations\n");
3289 fprintf(fmk,
"\t\t@rm -rf cxx_repository\n");
3291 fprintf(fmk,
"# Dependencies\n");
3293 fprintf(fmk,
"%sProjectSource.$(ObjSuf): %sProjectHeaders.h %sLinkDef.h %sProjectDict.$(SrcSuf)\n", pack, pack, pack, pack);
3295 fprintf(fmk,
"%sProjectDict.$(SrcSuf): %sProjectHeaders.h %sLinkDef.h\n", pack, pack, pack);
3296 fprintf(fmk,
"\t\t@echo \"Generating dictionary $@...\"\n");
3297 fprintf(fmk,
"\t\t@rootcint -f $@ -c $^\n");
3299 fprintf(fmk,
".$(SrcSuf).$(ObjSuf):\n");
3300 fprintf(fmk,
"\t\t$(CXX) $(CXXFLAGS) -c $<\n");
3318 if (!proofinf || (proofinf && strlen(proofinf) <= 0)) {
3319 Error(
"MakeProjectParProofInf",
"directory path undefined!");
3327 Error(
"MakeProjectParProofInf",
"path '%s' %s", proofinf,
3328 ((rcst == 0) ?
"is not a directory" :
"does not exist"));
3333 if (!pack || (pack && strlen(pack) <= 0)) {
3334 Error(
"MakeProjectParProofInf",
"package name undefined!");
3341 path.
Form(
"%s/BUILD.sh", proofinf);
3343 FILE *
f = fopen(path.
Data(),
"wb");
3345 FILE *f = fopen(path.
Data(),
"w");
3348 Error(
"MakeProjectParProofInf",
"cannot create file '%s' (errno: %d)",
3353 fprintf(f,
"#! /bin/sh\n");
3354 fprintf(f,
"# Build libEvent library.\n");
3357 fprintf(f,
"# The environment variables ROOTPROOFLITE and ROOTPROOFCLIENT can be used to\n");
3358 fprintf(f,
"# adapt the script to the calling environment\n");
3360 fprintf(f,
"# if test ! \"x$ROOTPROOFLITE\" = \"x\"; then\n");
3361 fprintf(f,
"# echo \"event-BUILD: PROOF-Lite node (session has $ROOTPROOFLITE workers)\"\n");
3362 fprintf(f,
"# elif test ! \"x$ROOTPROOFCLIENT\" = \"x\"; then\n");
3363 fprintf(f,
"# echo \"event-BUILD: PROOF client\"\n");
3364 fprintf(f,
"# else\n");
3365 fprintf(f,
"# echo \"event-BUILD: standard PROOF node\"\n");
3366 fprintf(f,
"# fi\n");
3368 fprintf(f,
"if [ \"\" = \"clean\" ]; then\n");
3369 fprintf(f,
" make distclean\n");
3370 fprintf(f,
" exit 0\n");
3373 fprintf(f,
"make\n");
3374 fprintf(f,
"rc=$?\n");
3375 fprintf(f,
"echo \"rc=$?\"\n");
3376 fprintf(f,
"if [ $? != \"0\" ] ; then\n");
3377 fprintf(f,
" exit 1\n");
3379 fprintf(f,
"exit 0\n");
3385 path.
Form(
"%s/SETUP.C", proofinf);
3387 f = fopen(path.
Data(),
"wb");
3389 f = fopen(path.
Data(),
"w");
3392 Error(
"MakeProjectParProofInf",
"cannot create file '%s' (errno: %d)",
3397 fprintf(f,
"Int_t SETUP()\n");
3401 fprintf(f,
"// The environment variables ROOTPROOFLITE and ROOTPROOFCLIENT can be used to\n");
3402 fprintf(f,
"// adapt the macro to the calling environment\n");
3404 fprintf(f,
"// if (gSystem->Getenv(\"ROOTPROOFLITE\")) {\n");
3405 fprintf(f,
"// Printf(\"event-SETUP: PROOF-Lite node (session has %%s workers)\",\n");
3406 fprintf(f,
"// gSystem->Getenv(\"ROOTPROOFLITE\"));\n");
3407 fprintf(f,
"// } else if (gSystem->Getenv(\"ROOTPROOFCLIENT\")) {\n");
3408 fprintf(f,
"// Printf(\"event-SETUP: PROOF client\");\n");
3409 fprintf(f,
"// } else {\n");
3410 fprintf(f,
"// Printf(\"event-SETUP: standard PROOF node\");\n");
3411 fprintf(f,
"// }\n");
3413 fprintf(f,
" if (gSystem->Load(\"lib%s\") == -1)\n", pack);
3414 fprintf(f,
" return -1;\n");
3415 fprintf(f,
" return 0;\n");
3449 if (version > 1000000) version -= 1000000;
3450 if (version < 53419 || (59900 < version && version < 59907)) {
3465 if (!base)
continue;
3477 for (
int mode=0;mode<2; ++mode) {
3490 if (strcmp(obj->
GetName(),
"listOfRules")==0) {
3498 rulelnk = rulelnk->
Next();
3502 Warning(
"ReadStreamerInfo",
"%s has a %s in the list of TStreamerInfo.",
GetName(), info->IsA()->
GetName());
3512 Warning(
"ReadStreamerInfo",
"The StreamerInfo for %s does not have a list of elements.",info->
GetName());
3517 Bool_t isstl = element && strcmp(
"This",element->
GetName())==0;
3519 if ( (!isstl && mode ==0) || (isstl && mode ==1) ) {
3528 printf(
"ReadStreamerInfo, class:%s, illegal uid=%d\n",info->
GetName(),uid);
3588 for (
Int_t i=0;i<npids;i++) {
3596 snprintf(name,32,
"ProcessID%d",npids);
3600 Info(
"WriteProcessID",
"name=%s, file=%s", name,
GetName());
3634 listOfRules.
SetName(
"listOfRules");
3635 std::set<TClass*> classSet;
3639 Int_t uid = info->GetNumber();
3642 if (
gDebug > 0) printf(
" -class: %s info number %d saved\n",info->GetName(),uid);
3647 if (clinfo && clinfo->GetSchemaRules()) {
3648 if ( classSet.find( clinfo ) == classSet.end() ) {
3649 if (
gDebug > 0) printf(
" -class: %s stored the I/O customization rules\n",info->GetName());
3655 rule->AsString(obj->
String());
3656 listOfRules.
Add(obj);
3658 classSet.insert(clinfo);
3669 list.
Add(&listOfRules);
3706 "you want to read through a cache, but you have no valid cache "
3707 "directory set - reading remotely");
3708 ::Info(
"TFile::OpenFromCache",
"set cache directory using TFile::SetCacheFileDir()");
3717 "you want to read through a cache, but you are reading "
3718 "local files - CACHEREAD disabled");
3725 cachefilepath += fileurl.
GetFile();
3729 ::Warning(
"TFile::OpenFromCache",
"you want to read through a cache, but I "
3730 "cannot create the directory %s - CACHEREAD disabled",
3731 cachefilepathbasedir.
Data());
3736 cachefilepath +=
"__";
3740 if (strstr(name,
"zip=")) {
3745 Int_t optioncount = 0;
3754 if (optioncount!=0) {
3759 newoptions += value;
3769 cachefilepath +=
"__";
3770 cachefilepath += zipname;
3784 char cacheblock[256];
3785 char remotblock[256];
3788 cfurl = cachefilepath;
3789 cfurl +=
"?filetype=raw";
3792 ropt +=
"&filetype=raw";
3805 ::Error(
"TFile::OpenFromCache",
3806 "cannot open the cache file to check cache consistency");
3811 ::Error(
"TFile::OpenFromCache",
3812 "cannot open the remote file to check cache consistency");
3819 if ((!cachefile->
ReadBuffer(cacheblock,256)) &&
3821 if (memcmp(cacheblock, remotblock, 256)) {
3822 ::Warning(
"TFile::OpenFromCache",
"the header of the cache file "
3823 "differs from the remote file - forcing an update");
3827 ::Warning(
"TFile::OpenFromCache",
"the header of the cache and/or "
3828 "remote file are not readable - forcing an update");
3842 if (need2copy && !
TFile::Cp(name, cachefilepath)) {
3843 ::Warning(
"TFile::OpenFromCache",
"you want to read through a cache, but I "
3844 "cannot make a cache copy of %s - CACHEREAD disabled",
3845 cachefilepathbasedir.
Data());
3851 ::Info(
"TFile::OpenFromCache",
"using local cache copy of %s [%s]",
3852 name, cachefilepath.
Data());
3855 fileurl.
SetFile(cachefilepath);
3859 tagfile = cachefilepath;
3860 tagfile +=
".ROOT.cachefile";
3916 if (!url || strlen(url) <= 0) {
3917 ::Error(
"TFile::Open",
"no url specified");
3930 TString sto = opts(ito + strlen(
"TIMEOUT="), opts.
Length());
3935 if (
gDebug > 0)
::Info(
"TFile::Open",
"timeout of %d millisec requested", toms);
3937 sto.
Insert(0,
"TIMEOUT=");
3955 ::Info(
"TFile::Open",
"waited %d millisec for asynchronous open", toms - xtms);
3957 ::Info(
"TFile::Open",
"timeout option not supported (requires asynchronous"
3962 ::Error(
"TFile::Open",
"timeout expired while opening '%s'", expandedUrl.
Data());
3969 ::Warning(
"TFile::Open",
"incomplete 'TIMEOUT=' option specification - ignored");
3975 const char *option = opts;
3978 TString namelist(expandedUrl);
3995 while (namelist.
Tokenize(n, from,
"|") && !
f) {
3998 if (!strcasecmp(option,
"CACHEREAD") ||
4021 if (urlOptions.BeginsWith(
"pmerge") || urlOptions.Contains(
"&pmerge") || urlOptions.Contains(
" pmerge")) {
4030 type =
GetType(name, option, &lfname);
4038 lfname = urlname.
GetUrl();
4040 f =
new TFile(lfname.
Data(), option, ftitle, compress);
4042 }
else if (type ==
kNet) {
4045 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TFile", name))) {
4051 }
else if (type ==
kWeb) {
4054 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TFile", name))) {
4060 }
else if (type ==
kFile) {
4063 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TFile", name)) &&
4068 f =
new TFile(name.
Data(), option, ftitle, compress);
4073 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TFile", name.
Data()))) {
4095 f =
TFile::Open( newUrl, option, ftitle, compress );
4158 if (!url || strlen(url) <= 0) {
4159 ::Error(
"TFile::AsyncOpen",
"no url specified");
4171 TString outf =
".TFileAsyncOpen_";
4182 while (namelist.
Tokenize(n, from,
"|") && !
f) {
4195 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TFile", name)) &&
4196 (!strcmp(h->
GetClass(),
"TXNetFile") || !strcmp(h->
GetClass(),
"TNetXNGFile"))
4202 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TFile", name)) &&
4214 if (!notfound && !f)
4285 #if defined(R__WINGCC)
4289 #elif defined(R__SEEK64)
4290 return ::open64(pathname, flags, mode);
4301 if (fd < 0)
return 0;
4329 #if defined (R__SEEK64)
4330 return ::lseek64(fd, offset, whence);
4331 #elif defined(WIN32)
4332 return ::_lseeki64(fd, offset, whence);
4334 return ::lseek(fd, offset, whence);
4361 return ::_commit(fd);
4439 ::Error(
"TFile::SetCacheFileDir",
"no sufficient permissions on cache directory %s or cannot create it", cachedir);
4481 cachetagfile +=
".tag.ROOT.cache";
4485 if (lastcleanuptime < cleanupinterval) {
4486 ::Info(
"TFile::ShrinkCacheFileDir",
"clean-up is skipped - last cleanup %lu seconds ago - you requested %lu", lastcleanuptime, cleanupinterval);
4492 cachetagfile +=
"?filetype=raw";
4495 if (!(tagfile =
TFile::Open(cachetagfile,
"RECREATE"))) {
4496 ::Error(
"TFile::ShrinkCacheFileDir",
"cannot create the cache tag file %s", cachetagfile.
Data());
4504 #if defined(R__WIN32)
4505 cmd =
"echo <TFile::ShrinkCacheFileDir>: cleanup to be implemented";
4506 #elif defined(R__MACOSX)
4507 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);
4509 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);
4516 ::Error(
"TFile::ShrinkCacheFileDir",
"error executing clean-up script");
4628 if (re.
Match(name)) {
4646 forceRemote =
kTRUE;
4647 else if (opts.
Contains(
"remote=0"))
4656 if (fname[0] ==
'/') {
4658 lfname.
Form(
"%s%s", prefix->
Data(), fname);
4661 }
else if (fname[0] ==
'~' || fname[0] ==
'$') {
4679 if (localFile && prefix)
4685 type = (localFile) ?
kLocal : type;
4686 }
else if (
TPMERegexp(
"^(http[s]?|s3http[s]?|[a]?s3|gs|gshttp[s]?){1}:",
"i").
Match(name)) {
4690 }
else if (!strncmp(name,
"file:", 5)) {
4716 if (of && (of->
GetSize() > 0)) {
4719 while ((f = (
TFile *)nxf()))
4733 if (handle && handle->
fFile) {
4763 if (of && (of->
GetSize() > 0)) {
4766 while ((f = (
TFile *)nxf()))
4772 return (
const TUrl *)0;
4780 fprintf(stderr,
"[TFile::Cp] Total %.02f MB\t|", (
Double_t)size/1048576);
4782 for (
int l = 0;
l < 20;
l++) {
4784 if (
l < 20*bytesread/size)
4785 fprintf(stderr,
"=");
4786 else if (
l == 20*bytesread/size)
4787 fprintf(stderr,
">");
4788 else if (
l > 20*bytesread/size)
4789 fprintf(stderr,
".");
4791 fprintf(stderr,
"=");
4797 fprintf(stderr,
"| %.02f %% [%.01f MB/s]\r",
4798 100.0*(size?(bytesread/((
float)size)):1), (lCopy_time>0.)?bytesread/lCopy_time/1048576.:0.);
4822 if (opt !=
"") opt +=
"&";
4831 char *copybuffer = 0;
4833 TFile *sfile =
this;
4850 ::Error(
"TFile::Cp",
"cannot open destination file %s", dst);
4856 rmdestiferror =
kTRUE;
4861 copybuffer =
new char[buffersize];
4863 ::Error(
"TFile::Cp",
"cannot allocate the copy buffer");
4881 if (progressbar)
CpProgress(totalread, filesize,watch);
4886 if (filesize - b1 > (
Long64_t)buffersize) {
4887 readsize = buffersize;
4889 readsize = filesize - b1;
4892 if (readsize == 0)
break;
4898 if ((read <= 0) || readop) {
4899 ::Error(
"TFile::Cp",
"cannot read from source file %s. readsize=%lld read=%lld readop=%d",
4907 if ((written != read) || writeop) {
4908 ::Error(
"TFile::Cp",
"cannot write %lld bytes to destination file %s", read, dst);
4912 }
while (read == (
Long64_t)buffersize);
4916 fprintf(stderr,
"\n");
4922 if (dfile) dfile->
Close();
4924 if (dfile)
delete dfile;
4925 if (copybuffer)
delete[] copybuffer;
4927 if (rmdestiferror && (success !=
kTRUE))
4950 if (opt !=
"") opt +=
"&";
4956 opt +=
TString::Format(
"&cachesz=%d&readaheadsz=%d&rmpolicy=1", 4*buffersize, 2*buffersize);
4965 ::Error(
"TFile::Cp",
"cannot open source file %s", src);
4967 success = sfile->
Cp(dst, progressbar, buffersize);
4970 if (sfile) sfile->
Close();
4971 if (sfile)
delete sfile;
4980 #if defined(R__neverLINUX) && !defined(R__WINGCC)
4992 int advice = POSIX_FADV_WILLNEED;
4997 advice = POSIX_FADV_NORMAL;
5001 #if defined(R__SEEK64)
5004 Int_t result = posix_fadvise(
fD, offset, len, advice);
5009 return (result != 0);
5031 return ((bytes < 0) ? 0 : bytes);
virtual Bool_t SendFileCloseEvent(TFile *)
virtual void Map()
List the contents of a file sequentially.
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)
virtual Int_t GetNProcessIDs() const
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
static TProcessID * GetPID()
static: returns pointer to current TProcessID
R__EXTERN void **(* gThreadTsd)(void *, Int_t)
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 Int_t GetEntries() const
virtual const char * GetTitle() const
Returns title of object.
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.
std::string GetName(const std::string &scope_name)
double read(const std::string &file_name)
reading
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)
virtual Long64_t GetSize() const
Returns the current file size.
Char_t fUnits
Number of bytes for file pointers.
virtual void ls(Option_t *option="") const
List file contents.
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
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
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...
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 fBytesWrite
Number of bytes written to this file.
EAsyncOpenStatus
Asynchronous open request status.
virtual const char * WorkingDirectory()
Return working directory.
virtual Int_t GetErrno() const
Method returning errno. Is overriden in TRFIOFile.
Long64_t GetRelOffset() const
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.
double write(int n, const std::string &file_name, const std::string &vector_type, int compress=0)
writing
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.
void Fatal(const char *location, const char *msgfmt,...)
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.
virtual void ls(Option_t *option="") const
List (ls) all objects in this collection.
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.
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.
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.
static UInt_t fgOpenTimeout
Timeout for open operations in ms - 0 corresponds to blocking i/o.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual TList * GetList() const
const char * GetProtocol() const
virtual void Seek(Long64_t offset, ERelativeTo pos=kBeg)
Seek to a specific position in the file. Pos it either kBeg, kCur or kEnd.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual Long64_t GetBytesWritten() const
Return the total number of bytes written so far to the file.
static void SetFileReadCalls(Int_t readcalls=0)
virtual Bool_t ReadBuffer(char *buf, Int_t len)
Read a buffer from the file.
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.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
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.
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.
virtual const TUrl * GetEndpointUrl() const
static Bool_t ShrinkCacheFileDir(Long64_t shrinkSize, Long_t cleanupInteval=0)
Try to shrink the cache to the desired size.
virtual const char * GetClassName() const
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 TObject * FindObject(const char *name) const
Find an object in this list using its name.
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...
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.
TList * fInfoCache
!Cached list of the streamer infos in this file
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)=0
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 )
const char * GetOptions() const
Int_t Sizeof() const
return number of bytes occupied by this TFree on permanent storage
Long_t ExecPlugin(int nargs, const T &...params)
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.
static void SetReadaheadSize(Int_t bufsize=256000)
TString & Insert(Ssiz_t pos, const char *s)
virtual Long64_t GetSeekKey() const
Int_t GetBestBuffer() const
Return the best buffer size of objects on this file.
virtual void FillBuffer(char *&buffer)
Encode directory header into output buffer.
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.
void SysError(const char *location, const char *msgfmt,...)
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.
virtual Int_t WriteTObject(const TObject *obj, const char *name=0, Option_t *option="", Int_t bufsize=0)
Write object obj to this directory.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
virtual char * GetBuffer() const
TFree * AddFree(TList *lfree, Long64_t first, Long64_t last)
Add a new free segment to the list of free segments.
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 void SetFileBytesWritten(Long64_t bytes=0)
virtual TObject * Clone(const char *newname="") const
Make a clone of an collection using the Streamer facility.
const char * Data() const
TFileCacheRead * GetCacheRead(TObject *tree=0) const
Return a pointer to the current read cache.
static TObjArray * GetPIDs()
static: returns array of TProcessIDs
Int_t fNbytesInfo
Number of bytes for StreamerInfo record.
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
TMap * fCacheReadMap
!Pointer to the read cache (if any)
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
virtual Int_t GetClassVersion() const =0
Sequenceable collection abstract base class.
void Stop()
Stop the stopwatch.
virtual Bool_t IsOpen() const
Returns kTRUE in case file is open and kFALSE if file is not open.
TDatime fDatimeC
Date and time when directory is created.
Option_t * GetOption() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
virtual FILE * TempFileName(TString &base, const char *dir=0)
Create a secure temporary file by appending a unique 6 letter string to base.
virtual void ReadBuffer(char *&buffer)
Read string from I/O buffer.
static Bool_t GetReadStreamerInfo()
If the streamerinfos are to be read at file opening.
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
virtual Bool_t Flush()
Flush the current write buffer to the file.
virtual void SetCompressionLevel(Int_t level=1)
See comments for function SetCompressionSettings.
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.
virtual void WriteFree()
Write FREE linked list on the file.
TString fRealName
Effective real file name (not original url)
static Long64_t GetFileBytesRead()
Static function returning the total number of bytes read from all files.
Long64_t GetDecompressedSize() const
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'.
static TFile * OpenFromCache(const char *name, Option_t *="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Open a file for reading through the file cache.
void Clear()
Clear string without changing its capacity.
virtual Int_t GetBufferSize() const
static void GetDateTime(UInt_t datetime, Int_t &date, Int_t &time)
Static function that returns the date and time.
R__EXTERN TVirtualMonitoringWriter * gMonitoringWriter
static Long64_t GetFileBytesWritten()
Static function returning the total number of bytes written to all files.
virtual Int_t WriteFile(Int_t cycle=1, TFile *f=0)
Write the encoded object supported by this key.
virtual const char * GetMakeSharedLib() const
Return the command line use to make a shared library.
void Info(const char *location, const char *msgfmt,...)
TString & Append(const char *cs)
std::vector< std::vector< double > > Data
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
Bool_t IsWritable() const
Int_t Atoi() const
Return integer value of string.
void tobuf(char *&buf, Bool_t x)
TClass * GetClass() const
void Continue()
Resume a stopped stopwatch.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
A TProcessID identifies a ROOT job in a unique way in time and space.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Long64_t fSeekDir
Location of directory on file.
virtual void Delete(Option_t *option="")
Delete an object from the file.
virtual TString GetNewUrl()
void Error(const char *location, const char *msgfmt,...)
Int_t GetClassVersion() const
const char * GetArchiveName() const
R__EXTERN TPluginManager * gPluginMgr
virtual Int_t SysWrite(Int_t fd, const void *buf, Int_t len)
Interface to system write. All arguments like in POSIX write().
virtual const char * GetFlagsDebug() const
Return the debug flags.
void MayNotUse(const char *method)
This function can be used in classes that should override a certain function, but in the inherited cl...
virtual void IncrementProcessIDs()
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
virtual Int_t SysSync(Int_t fd)
Interface to system fsync. All arguments like in POSIX fsync().
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 Int_t Sizeof() const
Return the size in bytes of the directory header.
virtual void ls(Option_t *option="") const
List Directory contents.
TObject * UncheckedAt(Int_t i) const
virtual Int_t SysClose(Int_t fd)
Interface to system close. All arguments like in POSIX close().
static UInt_t GetOpenTimeout()
Returns open timeout (in ms).
virtual const char * GetSoExt() const
Get the shared library extension.
virtual void ShowStreamerInfo()
Show the StreamerInfo of all classes written to this file.
virtual Int_t SysRead(Int_t fd, void *buf, Int_t len)
Interface to system read. All arguments like in POSIX read().
Int_t IndexOf(const TObject *obj) const
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
TObjArray * GetElements() const
Long64_t fEND
Last used byte in file.
R__EXTERN TSystem * gSystem
TList * fKeys
Pointer to keys list in memory.
#define R__RWLOCK_RELEASE_READ(rwlock)
virtual Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode)
Interface to system open. All arguments like in POSIX open().
#define R__RWLOCK_RELEASE_WRITE(rwlock)
virtual void WriteStreamerInfo()
Write the list of TStreamerInfo as a single object in this file The class Streamer description for al...
A ROOT file is structured in Directories (like a file system).
virtual const char * GetLibraries(const char *regexp="", const char *option="", Bool_t isRegexp=kTRUE)
Return a space separated list of loaded shared libraries.
TObject * Remove(TObject *key)
Remove the (key,value) pair with key from the map.
virtual Int_t Write(const char *name=0, Int_t opt=0, Int_t bufsiz=0)
Write memory objects to this file.
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual void Delete(const char *namecycle="")
Delete object namecycle.
void SetBaseCheckSum(UInt_t cs)
virtual Bool_t WriteBuffer(const char *buf, Int_t len)
Write a buffer to the file.
TObject * GetObject() const
const char * GetHostFQDN() const
Return fully qualified domain name of url host.
UInt_t GetCheckSum() const
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
Bool_t HasInterpreterInfo() const
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Int_t IncrementCount()
Increase the reference count to this object.
Bool_t TestBit(UInt_t f) const
virtual Bool_t ReadFile()
Read the key structure from the file.
virtual void MakeFree(Long64_t first, Long64_t last)
Mark unused bytes on the file.
Int_t fNbytesName
Number of bytes in TNamed at creation time.
const char * GetFileAndOptions() const
Return the file and its options (the string specified behind the ?).
virtual void SetFile(TFile *file, TFile::ECacheAction action=TFile::kDisconnect)
Set the file using this cache and reset the current blocks (if any).
static std::atomic< Long64_t > fgFileCounter
Counter for all opened files.
Int_t DecrementCount()
The reference fCount is used to delete the TProcessID in the TFile destructor when fCount = 0...
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...
static std::atomic< Long64_t > fgBytesWrite
Number of bytes written by all TFile objects.
virtual const char * GetName() const
Returns name of object.
static void CpProgress(Long64_t bytesread, Long64_t size, TStopwatch &watch)
Print file copy progress.
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
static std::atomic< Int_t > fgReadCalls
Number of bytes read from all TFile objects.
The ROOT global object gROOT contains a list of all defined classes.
virtual void Draw(Option_t *option="")
Fill Graphics Structure and Paint.
virtual void Delete(const char *namecycle="")
Delete Objects or/and keys in a directory.
virtual Int_t Exec(const char *shellcmd)
Execute a command.
virtual TList * GetStreamerInfoList()
Read the list of TStreamerInfo objects written to this file.
void Build(TFile *motherFile=0, TDirectory *motherDir=0)
Initialise directory to defaults.
const char * GetAnchor() const
static Int_t GetFileReadCalls()
Static function returning the total number of read calls from all files.
Version_t GetClassVersion() const
virtual TObjLink * FirstLink() const
void SetName(const char *name)
virtual TObject * ReadObjWithBuffer(char *bufferRead)
To read a TObject* from bufferRead.
virtual void Init(Bool_t create)
Initialize a TFile object.
virtual Int_t GetBytesToPrefetch() const
Max number of bytes to prefetch.
virtual void FreeDirectory(void *dirp)
Free a directory.
Int_t ReadBufferViaCache(char *buf, Int_t len)
Read buffer via cache.
static TFile *& CurrentFile()
Return the current ROOT file if any.
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Bool_t fWritable
True if directory is writable.
Int_t AppendKey(TKey *key)
Insert key in the linked list of keys of this directory.
virtual Int_t OpenArchive()=0
#define R__LOCKGUARD2(mutex)
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...
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
virtual void ReadBuffer(char *&buffer)
Decode one free structure from input buffer.
static Bool_t fgOnlyStaged
Before the file is opened, it is checked, that the file is staged, if not, the open fails...
static Bool_t GetOnlyStaged()
Returns staged only flag.
virtual void ReadStreamerInfo()
Read the list of StreamerInfo from this file.
virtual Long64_t GetBytesRead() const
Double_t fSum2Buffer
Sum of squares of buffer sizes of objects written so far.
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
virtual Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=0)
Redirect standard output (stdout, stderr) to the specified file.
void CheckInit()
Initialize fObjects.
void SetHost(const char *host)
TString & Remove(Ssiz_t pos)
TFile()
File default Constructor.
static void Add(TGlobalMappedFunction *gmf)
virtual int Chmod(const char *file, UInt_t mode)
Set the file permission bits. Returns -1 in case or error, 0 otherwise.
virtual void SysError(const char *method, const char *msgfmt,...) const
Issue system error message.
TList * fFree
Free segments linked list table.
void ReadKeyBuffer(char *&buffer)
Decode input buffer.
void SetAnchor(const char *anchor)
virtual const char * GetIncludePath()
Get the list of include path.
virtual Int_t GetSize() const
virtual void SetName(const char *newname)
Set the name for directory If the directory name is changed after the directory was written once...
Int_t GetCompress() const
virtual const char * GetFlagsOpt() const
Return the optimization flags.
Int_t fNbytesFree
Number of bytes for free segments structure.
static Bool_t fgCacheFileForce
Indicates, to force all READ to CACHEREAD.
TFile * fFile
TFile instance of the file being opened.
virtual const char * GetName() const
Returns name of object.
Long64_t GetFirst() const
virtual Int_t ReadKeys(Bool_t forceRead=kTRUE)
Read the linked list of keys.
virtual int Symlink(const char *from, const char *to)
Create a symbolic link from file1 to file2.
static Int_t GetReadaheadSize()
Static function returning the readahead buffer size.
#define R__RWLOCK_ACQUIRE_READ(rwlock)
Describe directory structure in memory.
Wrapper around a TObject so it can be stored in a TList.
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
virtual void Clear(Option_t *option="")
delete the TObjArray pointing to referenced objects this function is called by TFile::Close("R") ...
virtual void Print(Option_t *option="") const
Print all objects in the file.
Bool_t fNoAnchorInName
!True if we don't want to force the anchor to be appended to the file name
void SetWritable(Bool_t writable=kTRUE)
Set the new value of fWritable recursively.
static const TString & GetEtcDir()
Get the sysconfig directory in the installation. Static utility function.
The TTimeStamp encapsulates seconds and ns since EPOCH.
static Bool_t fgCacheFileDisconnected
Indicates, we trust in the files in the cache dir without stat on the cached file.
TList * fOpenPhases
!Time info about open phases
virtual Int_t Sizeof() const
Return the size in bytes of the file header.
TString fOption
File options.
Int_t GetEntries() const
Return the number of objects in array (i.e.
Bool_t fMustFlush
!True if the file buffers must be flushed
static TProcessID * GetSessionProcessID()
static function returning the pointer to the session TProcessID
Float_t GetCompressionFactor()
Return the file compression factor.
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 Clear(Option_t *option="")
Remove all objects from the list.
const TMatches FindRules(const TString &source) const
Return all the rules that are about the given 'source' class.
virtual Bool_t SendFileReadProgress(TFile *)
virtual void Close(Option_t *option="")
Delete all objects from memory and directory structure itself.
virtual Int_t SetCurrentMember()=0
virtual UInt_t GetUniqueID() const
Return the unique object id.
Int_t Match(const TString &s, UInt_t start=0)
Runs a match on s against the regex 'this' was created with.
Bool_t fIsRootFile
!True is this is a ROOT file, raw file otherwise
virtual void AddAfter(const TObject *after, TObject *obj)
Insert object after object after in the list.
const char * GetMemberName() const
const TList * GetStreamerInfoCache()
Returns the cached list of StreamerInfos used in this file.
virtual Int_t Sizeof() const
Return size of the TNamed part of the TObject.
Mother of all ROOT objects.
Bool_t FlushWriteCache()
Flush the write cache if active.
static Bool_t SetOnlyStaged(Bool_t onlystaged)
Sets only staged flag.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual void Paint(Option_t *option="")
Paint all objects in the file.
virtual Int_t GetNkeys() const
virtual void SetCompressionSettings(Int_t settings=1)
Used to specify the compression level and algorithm.
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
static TString fgCacheFileDir
Directory where to locally stage files.
static Int_t IncreaseDirLevel()
Increase the indentation level for ls().
static TString UpdateAssociativeToVector(const char *name)
If we have a map, multimap, set or multiset, plus unordered partners, and the key is a class...
void BuildCheck(TFile *file=0)
Check if built and consistent with the class dictionary.
virtual ~TFile()
File destructor.
Bool_t R_ISDIR(Int_t mode)
virtual Int_t WriteBuffer(const char *buf, Long64_t pos, Int_t len)
Write buffer at position pos in the write buffer.
static TFileOpenHandle * AsyncOpen(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Submit an asynchronous open request.
static Bool_t SetCacheFileDir(const char *cacheDir, Bool_t operateDisconnected=kTRUE, Bool_t forceCacheread=kFALSE)
Sets the directory where to locally stage/cache remote files.
virtual TFile * GetFile() const
virtual void Add(TObject *obj)
Int_t MakeProjectParProofInf(const char *packname, const char *proofinfdir)
Create BUILD.sh and SETUP.C under 'proofinf' for PAR package 'pack'.
Wrapper for PCRE library (Perl Compatible Regular Expressions).
virtual void ShowOutput(RedirectHandle_t *h)
Display the content associated with the redirection described by the opaque handle 'h'...
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 Bool_t ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf)
Read the nbuf blocks described in arrays pos and len.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual const char * GetObjExt() const
Get the object file extension.
void SetOptions(const char *opt)
Int_t fNProcessIDs
Number of TProcessID written to this file.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
virtual Int_t GetBytesInCache() const
const ROOT::Detail::TSchemaRuleSet * GetSchemaRules() const
Return the set of the schema rules if any.
static UInt_t SetOpenTimeout(UInt_t timeout)
Sets open timeout time (in ms). Returns previous timeout value.
virtual int CopyFile(const char *from, const char *to, Bool_t overwrite=kFALSE)
Copy a file.
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
void FillBuffer(char *&buffer)
Stream UUID into output buffer.
virtual void SetCompressionAlgorithm(Int_t algorithm=0)
See comments for function SetCompressionSettings.
ROOT::ESTLType GetCollectionType() const
Return the 'type' of the STL the TClass is representing.
#define R__RWLOCK_ACQUIRE_WRITE(rwlock)
virtual Int_t ReadBuffer(char *buf, Long64_t pos, Int_t len)
Read buffer at position pos.
Long64_t GetMemberFilePosition() const
Return position in archive of current member.
Int_t fVersion
File format version.
Long64_t fArchiveOffset
!Offset at which file starts in archive
static void ResetErrno()
Static function resetting system error number.
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
Int_t fWritten
Number of objects written so far.
static Int_t fgReadaheadSize
Readahead buffer size.
Long64_t fOffset
!Seek offset cache
TObject * At(Int_t idx) const
virtual void WriteHeader()
Write File Header.
Bool_t fInitDone
!True if the file has been initialized
TFileOpenHandle * fAsyncHandle
!For proper automatic cleanup
virtual void Close(Option_t *option="")
Close out any threads or asynchronous fetches used by the underlying implementation.
const char * GetClass() const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Abstract Interface class describing Streamer information for one class.
static void SetFileBytesRead(Long64_t bytes=0)
TObjArray * GetListOfProcessIDs() const
TArchiveMember * GetMember() const
Long64_t fSeekFree
Location on disk of free segments structure.
static Long64_t GetFileCounter()
virtual void SetCacheWrite(TFileCacheWrite *cache)
Set a pointer to the write cache.
virtual void ResetErrno() const
Method resetting the errno. Is overridden in TRFIOFile.
TFileCacheWrite * GetCacheWrite() const
Return a pointer to the current write cache.
Long64_t fBytesRead
Number of bytes read from this file.
const char * GetOpt() const
static const char * GetCacheFileDir()
Get the directory where to locally stage/cache remote files.
const char * GetFile() const
virtual TProcessID * ReadProcessID(UShort_t pidf)
The TProcessID with number pidf is read from this file.
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
A cache when writing files over the network.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
Int_t MakeProjectParMake(const char *packname, const char *filename)
Create makefile at 'filemake' for PAR package 'pack'.
virtual Bool_t ReadBufferAsync(Long64_t offs, Int_t len)
Int_t fNbytesKeys
Number of bytes for the keys.
TFileCacheWrite * fCacheWrite
!Pointer to the write cache (if any)
virtual void Close(Option_t *option="")
Close a file.
virtual Bool_t Matches(const char *name)
Return kTRUE if 'url' matches the coordinates of this file.
Array of chars or bytes (8 bits per element).
virtual EAsyncOpenStatus GetAsyncOpenStatus()
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.