If I try this, I get (not surprisingly) complaints that the file is busy.
Processing loadTest.C...
Hi
Warning in <ACLiC>: script has already been loaded in interpreted mode
Warning in <ACLiC>: unloading /mnt/autofs/cdf/home/cplager/analysis/pdf2/topToPdfWeights/pdfweights/./loadTest.C and compiling it
Function loadTest() busy. loaded after "/mnt/autofs/cdf/home/cplager/analysis/pdf2/topToPdfWeights/pdfweights/./loadTest.C"
Error: G__unloadfile() Can not unload "/mnt/autofs/cdf/home/cplager/analysis/pdf2/topToPdfWeights/pdfweights/./loadTest.C", file busy FILE:loadTest.C LINE:12
*** Interpreter error recovered ***
hello
I’m trying this in Root 4.00.08 and above. Is this possible?
Cheers,
Charles
p.s. Is there a way to get the full name of the file in the macro? I.e.,
OK, so it does work. But it needs one ugly hack, and we will fix this if we remember this issue (we == Philippe :-). If you see a TAclic showing up in ROOT, and it doesn’t have a flag “IgnoreBusy”, then please remind us.
There is one important caveat: do not create a function that is visible in both compiled and interpreted mode, or CINT’s dictionary will get utterly confused, especially after unloading either the script or the library. You have been warned
The macro is attached; I hope it has a sufficient amount of comments.
just to clarify: this is ugly because I’m hacking CINT’s perfectly reasonable protection not to load a file twice. CINT’s dictionary relies on functions being unique per process. Still, the future TAclic should probably allow users to disable this check, in some half-hidden way.