9a99763
diff -ur root-6.06.02.orig/hist/histpainter/src/THistPainter.cxx root-6.06.02/hist/histpainter/src/THistPainter.cxx
9a99763
--- root-6.06.02.orig/hist/histpainter/src/THistPainter.cxx	2016-03-03 10:36:03.000000000 +0100
9a99763
+++ root-6.06.02/hist/histpainter/src/THistPainter.cxx	2016-03-31 20:09:00.566638573 +0200
9a99763
@@ -1907,8 +1907,8 @@
9a99763
    Double_t lat2 = 50;
9a99763
    TH2Poly *p = new TH2Poly("USA","USA Population",lon1,lon2,lat1,lat2);
9a99763
 
9a99763
-   TFile *f;
9a99763
-   f = TFile::Open("http://root.cern.ch/files/usa.root");
9a99763
+   TFile::SetCacheFileDir(".");
9a99763
+   TFile *f = TFile::Open("http://root.cern.ch/files/usa.root", "CACHEREAD");
9a99763
 
9a99763
    TMultiGraph *mg;
9a99763
    TKey *key;
9a99763
diff -ur root-6.06.02.orig/test/stressGraphics.cxx root-6.06.02/test/stressGraphics.cxx
9a99763
--- root-6.06.02.orig/test/stressGraphics.cxx	2016-03-03 10:36:03.000000000 +0100
9a99763
+++ root-6.06.02/test/stressGraphics.cxx	2016-03-31 20:09:57.680125335 +0200
9a99763
@@ -1956,7 +1956,8 @@
9a99763
    Double_t lat2 = 50;
9a99763
    TH2Poly *p = new TH2Poly("USA","USA Population",lon1,lon2,lat1,lat2);
9a99763
 
9a99763
-   TFile *f = TFile::Open("http://root.cern.ch/files/usa.root");
9a99763
+   TFile::SetCacheFileDir(".");
9a99763
+   TFile *f = TFile::Open("http://root.cern.ch/files/usa.root", "CACHEREAD");
9a99763
 
9a99763
    if (!f) {
9a99763
       printf("Cannot access usa.root. Is internet working ?\n");
9a99763
diff -ur root-6.06.02.orig/test/stressHistogram.cxx root-6.06.02/test/stressHistogram.cxx
9a99763
--- root-6.06.02.orig/test/stressHistogram.cxx	2016-03-03 10:36:03.000000000 +0100
9a99763
+++ root-6.06.02/test/stressHistogram.cxx	2016-03-30 05:39:17.309313821 +0200
9a99763
@@ -10164,7 +10164,8 @@
9a99763
       refFile = TFile::Open(refFileName, "RECREATE");
9a99763
    }
9a99763
    else {
9a99763
-      refFile = TFile::Open(refFileName);
9a99763
+      TFile::SetCacheFileDir(".");
9a99763
+      refFile = TFile::Open(refFileName, "CACHEREAD");
9a99763
    }
9a99763
 
9a99763
    if ( refFile != 0 ) {
9a99763
diff -ur root-6.06.02.orig/test/stressRooFit.cxx root-6.06.02/test/stressRooFit.cxx
9a99763
--- root-6.06.02.orig/test/stressRooFit.cxx	2016-03-03 10:36:03.000000000 +0100
9a99763
+++ root-6.06.02/test/stressRooFit.cxx	2016-03-30 05:39:17.330313983 +0200
8c8b88f
@@ -78,9 +78,10 @@
9a99763
          cout << "stressRooFit ERROR: reference file must be local file in writing mode" << endl ;
9a99763
          return 1;
9a99763
       }
9a99763
-      fref = new TWebFile(refFile) ;
9a99763
+      TFile::SetCacheFileDir(".");
8c8b88f
+      fref = TFile::Open(refFile,"CACHEREAD") ;
9a99763
     } else {
8c8b88f
-      fref = new TFile(refFile,writeRef?"RECREATE":"") ;
8c8b88f
+      fref = TFile::Open(refFile,writeRef?"RECREATE":"") ;
9a99763
     }
8c8b88f
     if (fref->IsZombie()) {
8c8b88f
       cout << "stressRooFit ERROR: cannot open reference file " << refFile << endl ;
9a99763
diff -ur root-6.06.02.orig/test/stressTMVA.cxx root-6.06.02/test/stressTMVA.cxx
9a99763
--- root-6.06.02.orig/test/stressTMVA.cxx	2016-03-03 10:36:03.000000000 +0100
9a99763
+++ root-6.06.02/test/stressTMVA.cxx	2016-03-30 06:11:11.630058265 +0200
9a99763
@@ -2011,21 +2011,15 @@
9a99763
   factory->AddVariable( _VariableNames->at(3),                "Variable 4", "units", 'F' );
9a99763
 
9a99763
   TFile* input(0);
9a99763
-
9a99763
   FileStat_t stat;
9a99763
 
9a99763
-  TString fname = "../tmva/test/data/toy_sigbkg.root"; //tmva_example.root";
9a99763
-  const char *fcname = gSystem->ExpandPathName("$ROOTSYS/tmva/test/data/toy_sigbkg.root");
9a99763
+  TString fname = "./tmva_class_example.root";
9a99763
   if(!gSystem->GetPathInfo(fname,stat)) {
9a99763
      input = TFile::Open( fname );
9a99763
-  } else if(!gSystem->GetPathInfo("../"+fname,stat)) {
9a99763
-     input = TFile::Open( "../"+fname );
9a99763
-  } else if(fcname && !gSystem->GetPathInfo(fcname,stat)) {
9a99763
-     input = TFile::Open( fcname );
9a99763
   } else {
9a99763
-     input = TFile::Open( "http://root.cern.ch/files/tmva_class_example.root" );
9a99763
+     TFile::SetCacheFileDir(".");
9a99763
+     input = TFile::Open("http://root.cern.ch/files/tmva_class_example.root", "CACHEREAD");
9a99763
   }
9a99763
-  delete [] fcname;
9a99763
   if (input == NULL) {
9a99763
      cerr << "broken/inaccessible input file" << endl;
9a99763
   }
9a99763
@@ -2440,14 +2434,12 @@
9a99763
    TFile* input(0);
9a99763
    FileStat_t stat;
9a99763
 
9a99763
-   // FIXME:: give the filename of the sample somewhere else?
9a99763
-   TString fname = "../tmva/test/tmva_reg_example.root";
9a99763
+   TString fname = "./tmva_reg_example.root";
9a99763
    if(!gSystem->GetPathInfo(fname,stat)) {
9a99763
       input = TFile::Open( fname );
9a99763
-   } else if(!gSystem->GetPathInfo("../"+fname,stat)) {
9a99763
-      input = TFile::Open( "../"+fname );
9a99763
    } else {
9a99763
-      input = TFile::Open( "http://root.cern.ch/files/tmva_reg_example.root" );
9a99763
+      TFile::SetCacheFileDir(".");
9a99763
+      input = TFile::Open("http://root.cern.ch/files/tmva_reg_example.root", "CACHEREAD");
9a99763
    }
9a99763
    if (input == NULL) {
9a99763
       cerr << "broken/inaccessible input file" << endl;
9a99763
diff -ur root-6.06.02.orig/tmva/pymva/test/Classification.C root-6.06.02/tmva/pymva/test/Classification.C
9a99763
--- root-6.06.02.orig/tmva/pymva/test/Classification.C	2016-03-03 10:36:03.000000000 +0100
9a99763
+++ root-6.06.02/tmva/pymva/test/Classification.C	2016-04-01 18:09:27.283029169 +0200
9a99763
@@ -27,23 +27,26 @@
9a99763
    TMVA::Factory *factory = new TMVA::Factory("TMVAClassification", outputFile,
9a99763
          "!V:!Silent:Color:DrawProgressBar:Transformations=I;D;P;G,D:AnalysisType=Classification");
9a99763
 
9a99763
-
9a99763
    factory->AddVariable("myvar1 := var1+var2", 'F');
9a99763
    factory->AddVariable("myvar2 := var1-var2", "Expression 2", "", 'F');
9a99763
    factory->AddVariable("var3",                "Variable 3", "units", 'F');
9a99763
    factory->AddVariable("var4",                "Variable 4", "units", 'F');
9a99763
-
9a99763
-
9a99763
    factory->AddSpectator("spec1 := var1*2",  "Spectator 1", "units", 'F');
9a99763
    factory->AddSpectator("spec2 := var1*3",  "Spectator 2", "units", 'F');
9a99763
 
9a99763
-
9a99763
+   TFile *input(0);
9a99763
    TString fname = "./tmva_class_example.root";
9a99763
-
9a99763
-   if (gSystem->AccessPathName(fname))    // file does not exist in local directory
9a99763
-      gSystem->Exec("curl -O http://root.cern.ch/files/tmva_class_example.root");
9a99763
-
9a99763
-   TFile *input = TFile::Open(fname);
9a99763
+   if (!gSystem->AccessPathName( fname )) {
9a99763
+      input = TFile::Open( fname ); // check if file in local directory exists
9a99763
+   }
9a99763
+   else {
9a99763
+      TFile::SetCacheFileDir(".");
9a99763
+      input = TFile::Open("http://root.cern.ch/files/tmva_class_example.root", "CACHEREAD");
9a99763
+   }
9a99763
+   if (!input) {
9a99763
+      std::cout << "ERROR: could not open data file" << std::endl;
9a99763
+      exit(1);
9a99763
+   }
9a99763
 
9a99763
    std::cout << "--- TMVAClassification       : Using input file: " << input->GetName() << std::endl;
9a99763
 
9a99763
diff -ur root-6.06.02.orig/tmva/rmva/test/Classification.C root-6.06.02/tmva/rmva/test/Classification.C
9a99763
--- root-6.06.02.orig/tmva/rmva/test/Classification.C	2016-03-03 10:36:03.000000000 +0100
9a99763
+++ root-6.06.02/tmva/rmva/test/Classification.C	2016-04-01 18:09:50.932225431 +0200
9a99763
@@ -36,12 +36,19 @@
9a99763
    factory->AddSpectator("spec1 := var1*2",  "Spectator 1", "units", 'F');
9a99763
    factory->AddSpectator("spec2 := var1*3",  "Spectator 2", "units", 'F');
9a99763
 
9a99763
+   TFile *input(0);
9a99763
    TString fname = "./tmva_class_example.root";
9a99763
-
9a99763
-   if (gSystem->AccessPathName(fname))    // file does not exist in local directory
9a99763
-      gSystem->Exec("curl -O http://root.cern.ch/files/tmva_class_example.root");
9a99763
-
9a99763
-   TFile *input = TFile::Open(fname);
9a99763
+   if (!gSystem->AccessPathName( fname )) {
9a99763
+      input = TFile::Open( fname ); // check if file in local directory exists
9a99763
+   }
9a99763
+   else {
9a99763
+      TFile::SetCacheFileDir(".");
9a99763
+      input = TFile::Open("http://root.cern.ch/files/tmva_class_example.root", "CACHEREAD");
9a99763
+   }
9a99763
+   if (!input) {
9a99763
+      std::cout << "ERROR: could not open data file" << std::endl;
9a99763
+      exit(1);
9a99763
+   }
9a99763
 
9a99763
    std::cout << "--- TMVAClassification       : Using input file: " << input->GetName() << std::endl;
9a99763
 
9a99763
diff -ur root-6.06.02.orig/tutorials/hist/th2polyUSA.C root-6.06.02/tutorials/hist/th2polyUSA.C
9a99763
--- root-6.06.02.orig/tutorials/hist/th2polyUSA.C	2016-03-03 10:36:03.000000000 +0100
9a99763
+++ root-6.06.02/tutorials/hist/th2polyUSA.C	2016-03-31 20:10:42.970511332 +0200
9a99763
@@ -44,8 +44,8 @@
9a99763
    Double_t lat2 = 50;
9a99763
    TH2Poly *p = new TH2Poly("USA","USA Population",lon1,lon2,lat1,lat2);
9a99763
 
9a99763
-   TFile *f;
9a99763
-   f = TFile::Open("http://root.cern.ch/files/usa.root");
9a99763
+   TFile::SetCacheFileDir(".");
9a99763
+   TFile *f = TFile::Open("http://root.cern.ch/files/usa.root", "CACHEREAD");
9a99763
 
9a99763
    if (!f) {
9a99763
       printf("Cannot access usa.root. Is internet working ?\n");
9a99763
diff -ur root-6.06.02.orig/tutorials/tmva/TMVAClassificationApplication.C root-6.06.02/tutorials/tmva/TMVAClassificationApplication.C
9a99763
--- root-6.06.02.orig/tutorials/tmva/TMVAClassificationApplication.C	2016-03-03 10:36:03.000000000 +0100
9a99763
+++ root-6.06.02/tutorials/tmva/TMVAClassificationApplication.C	2016-04-01 18:06:14.522429453 +0200
9a99763
@@ -221,14 +221,16 @@
9a99763
    // Prepare input tree (this must be replaced by your data source)
9a99763
    // in this example, there is a toy tree with signal and one with background events
9a99763
    // we'll later on use only the "signal" events for the test in this example.
9a99763
-   //   
9a99763
+   //
9a99763
    TFile *input(0);
9a99763
-   TString fname = "./tmva_example.root";   
9a99763
-   if (!gSystem->AccessPathName( fname )) 
9a99763
+   TString fname = "./tmva_class_example.root";
9a99763
+   if (!gSystem->AccessPathName( fname )) {
9a99763
       input = TFile::Open( fname ); // check if file in local directory exists
9a99763
-   else    
9a99763
-      input = TFile::Open( "http://root.cern.ch/files/tmva_class_example.root" ); // if not: download from ROOT server
9a99763
-   
9a99763
+   }
9a99763
+   else {
9a99763
+      TFile::SetCacheFileDir(".");
9a99763
+      input = TFile::Open("http://root.cern.ch/files/tmva_class_example.root", "CACHEREAD"); // if not: download from ROOT server
9a99763
+   }
9a99763
    if (!input) {
9a99763
       std::cout << "ERROR: could not open data file" << std::endl;
9a99763
       exit(1);
9a99763
diff -ur root-6.06.02.orig/tutorials/tmva/TMVAClassification.C root-6.06.02/tutorials/tmva/TMVAClassification.C
9a99763
--- root-6.06.02.orig/tutorials/tmva/TMVAClassification.C	2016-03-03 10:36:03.000000000 +0100
9a99763
+++ root-6.06.02/tutorials/tmva/TMVAClassification.C	2016-04-01 18:05:40.808149659 +0200
9a99763
@@ -201,13 +201,19 @@
9a99763
 
9a99763
    // Read training and test data
9a99763
    // (it is also possible to use ASCII format as input -> see TMVA Users Guide)
9a99763
+   TFile *input(0);
9a99763
    TString fname = "./tmva_class_example.root";
9a99763
-   
9a99763
-   if (gSystem->AccessPathName( fname ))  // file does not exist in local directory
9a99763
-      gSystem->Exec("curl -O http://root.cern.ch/files/tmva_class_example.root");
9a99763
-   
9a99763
-   TFile *input = TFile::Open( fname );
9a99763
-   
9a99763
+   if (!gSystem->AccessPathName( fname )) {
9a99763
+      input = TFile::Open( fname ); // check if file in local directory exists
9a99763
+   }
9a99763
+   else {
9a99763
+      TFile::SetCacheFileDir(".");
9a99763
+      input = TFile::Open("http://root.cern.ch/files/tmva_class_example.root", "CACHEREAD");
9a99763
+   }
9a99763
+   if (!input) {
9a99763
+      std::cout << "ERROR: could not open data file" << std::endl;
9a99763
+      exit(1);
9a99763
+   }
9a99763
    std::cout << "--- TMVAClassification       : Using input file: " << input->GetName() << std::endl;
9a99763
    
9a99763
    // --- Register the training and test trees
9a99763
diff -ur root-6.06.02.orig/tutorials/tmva/TMVARegressionApplication.C root-6.06.02/tutorials/tmva/TMVARegressionApplication.C
9a99763
--- root-6.06.02.orig/tutorials/tmva/TMVARegressionApplication.C	2016-03-03 10:36:03.000000000 +0100
9a99763
+++ root-6.06.02/tutorials/tmva/TMVARegressionApplication.C	2016-04-01 18:07:00.137808013 +0200
9a99763
@@ -123,16 +123,16 @@
9a99763
    // Prepare input tree (this must be replaced by your data source)
9a99763
    // in this example, there is a toy tree with signal and one with background events
9a99763
    // we'll later on use only the "signal" events for the test in this example.
9a99763
-   //   
9a99763
+   //
9a99763
    TFile *input(0);
9a99763
    TString fname = "./tmva_reg_example.root";
9a99763
    if (!gSystem->AccessPathName( fname )) {
9a99763
       input = TFile::Open( fname ); // check if file in local directory exists
9a99763
-   } 
9a99763
-   else { 
9a99763
-      input = TFile::Open( "http://root.cern.ch/files/tmva_reg_example.root" ); // if not: download from ROOT server
9a99763
    }
9a99763
-   
9a99763
+   else {
9a99763
+      TFile::SetCacheFileDir(".");
9a99763
+      input = TFile::Open("http://root.cern.ch/files/tmva_reg_example.root", "CACHEREAD"); // if not: download from ROOT server
9a99763
+   }
9a99763
    if (!input) {
9a99763
       std::cout << "ERROR: could not open data file" << std::endl;
9a99763
       exit(1);
9a99763
diff -ur root-6.06.02.orig/tutorials/tmva/TMVARegression.C root-6.06.02/tutorials/tmva/TMVARegression.C
9a99763
--- root-6.06.02.orig/tutorials/tmva/TMVARegression.C	2016-03-03 10:36:03.000000000 +0100
9a99763
+++ root-6.06.02/tutorials/tmva/TMVARegression.C	2016-03-30 05:58:14.955076174 +0200
9a99763
@@ -158,11 +158,13 @@
9a99763
    // load the signal and background event samples from ROOT trees
9a99763
    TFile *input(0);
9a99763
    TString fname = "./tmva_reg_example.root";
9a99763
-   if (!gSystem->AccessPathName( fname )) 
9a99763
+   if (!gSystem->AccessPathName( fname )) {
9a99763
       input = TFile::Open( fname ); // check if file in local directory exists
9a99763
-   else 
9a99763
-      input = TFile::Open( "http://root.cern.ch/files/tmva_reg_example.root" ); // if not: download from ROOT server
9a99763
-   
9a99763
+   }
9a99763
+   else {
9a99763
+      TFile::SetCacheFileDir(".");
9a99763
+      input = TFile::Open("http://root.cern.ch/files/tmva_reg_example.root", "CACHEREAD"); // if not: download from ROOT server
9a99763
+   }
9a99763
    if (!input) {
9a99763
       std::cout << "ERROR: could not open data file" << std::endl;
9a99763
       exit(1);