I know practically nothing about TFile recovery system but reading the documentation of TFile.Recover (root.cern.ch/root/html/TFile.html#TFile:Recover) I see at the bottom:
One can disable the automatic recovery procedure by setting
in the system.rootrc file[/quote]
Is it possible to enable/disable the TFile.Recover option also programatically, i.e. in runtime (without using a .rootrc file)? How can I do it?
Many thanks in advance for your answer.
gEnv->GetValue("TFile.Recover", 0); // or 1 to turn it on
thanks a lot! This is what I was looking for.
what about in a compiled c++ code?
no luck with
The same, really. You need to manipulate the global variable gEnv:
gEnv->SetValue("TFile.Recover", 0); // or 1 to turn it onbut it looks like due to a typo in the previous message say GetValue where SetValue was needed.
In general I don’t quite understand all these global variables such as
gROOT, gSystem etc.
when you run in compiled c++ code.
Ok, you define the object for example TSystem * syst = new TSystem()
and you play as in an interpred enviroment, but I don’t fully know
what I am doing…
All the global variable/object (gROOT, gSystem, gEnv, etc.) that provide static services are prebuilt and you never need to allocate them (gSystem’s actually type depends on the platform for example).
Other variables that indicates/points to a state (like gDirectory and gFile) can be manipulated directly but will also be automatic updated (for example both are changed when you executed TFile *f = TFile::Open(…) to have the same value as ‘f’ which becomes the current directory).
Either way, to use them in compiled code, all you need to do is #include the corresponding header file.