Why CINT locks the scripts

Hi,

Why is it necessary to lock the loaded scripts?
Even, if I make a gROOT->Reset(), the file remains locked.
The only command that unlocks the file is “.q”.

Janos

Hi,

Which platform are you using? I suspect Windows. Currently CINT keep the script opens since it might go back to it to read the content. We hope to solve this kind of issue in the next major release of CINT (maybe in 6 months)

Cheers,
Philippe.

Hi,

you are right, I am using Win32. You are right that during processing a session ROOT can go back and read the script again, but following a gROOT->Reset(), I think it should release it, as it also does when quiting.

Also, I do not really know why ROOT needs exclusive access to a file it reads only.

Regards

Janos

[quote]Also, I do not really know why ROOT needs exclusive access to a file it reads only. [/quote]Well, modifying a file which is being read could have weird consequence. Anyway it works (per se) on other platforms. On windows just doing ‘fopen(filename,“r”)’ seems to lock the file!

Philippe.

[quote]Well, modifying a file which is being read could have weird consequence. Anyway it works (per se) on other platforms. On windows just doing ‘fopen(filename,“r”)’ seems to lock the file!

Philippe.[/quote]
I think, modifying a file is a normal process during developing, especially when using an interpreter. And, if it works (i.e does not lock) on other platforms, why should it [quote]have weird consequence[/quote] only on Win32 platform?
Otherwise, there exists fclose(), too. It could be called when control returns to CINT, and re-leaded when processing begins again, I guess. Even, gROOT->Reset() could call _fcloseall( ).

Janos

Watch out: I do most of my editing under Windows with a port of emacs (I just miss the good 'old UNIX tools).
For a reason or another, emacs-windows doesn’t really comply with the lock and allows you to save a script while CINT is running.
Don’t do it. It indeed has weird consequences :smiling_imp:.
I don’t remember what was the corresponding behaviour on other architectures. I should check someday.