File root not opened in write mode

Hello Rooters,

I have written a script. I want to read ANSII file and write to NTuple. But the script gives me the following error and warning. When i delete root file in the direction then it gives me this error and waning. I attach my script for you.

(Warning in TFile::Write: file tree1.root not opened in write mode
Error in TROOT::WriteTObject: The current directory (Rint) is not associated with a file. The object (ntuple) has not been written.)
caen.cpp (1.78 KB)


Most likely the file system your are trying to write to is either full or read-only. Your macro as in works for me.


PS. Avoid posting the same question on multiple forum/mailing list, this makes it harder for us to keep track. thanks.