Hi everyone. I have a class with some file.Write() in its destructor and found that if interactively I create an object and quit root, it would complain that the file is not writable. A search lead me to this post:
a.C (520 Bytes)
I run the attachment (I added #include and using statements to make ROOT take it) in ROOT 6.10/00:
$ root
| Welcome to ROOT 6.10/00 http://root.cern.ch |
| © 1995-2017, The ROOT Team |
| Built for linuxx8664gcc |
| From tag v6-10-00, 13 June 2017 |
Try ‘.help’, ‘.demo’, ‘.license’, ‘.credits’, ‘.quit’/’.q’ |
---|
root [0] .L a.C+
Info in TUnixSystem::ACLiC: creating shared library /home/pliu/sandbox/dtor/./a_C.so
root [1] a obj
a ctor
f1 Writable = 1
(a &) @0x(some memory address)
root [2] .q
a dtor
f1 Writable = 0
Warning in TFile::Write: file a.root not opened in write mode
$
And there is no histogram in a.root. pcanal said “This problem will be resolved in the context of ROOT 6 (and the replacement of CINT by Cling)”. I wonder if this is actually the case?