If I try to open a file via an xrootd URL, with the option “RECREATE”, I get an error:
root [0] TFile* f=TFile::Open("root://fndca1.fnal.gov:1094/pnfs/fnal.gov/usr/minerva/scratch/users/rodriges/myfile3.root", "RECREATE")
170609 08:57:35 24500 Xrd: CheckErrorStatus: Server [fndca4a.fnal.gov:1094] declared: Tried to write on read only file.(error code: 3007)
170609 08:57:35 24500 Xrd: CheckErrorStatus: Server [fndca4a.fnal.gov:1094] declared: Tried to write on read only file.(error code: 3007)
If I replace “RECREATE” with “NEW”, the command works and I can write to the file. Is this the intended behaviour? It’s different to how regular TFiles on the local disk work.
I looked at the source of TNetXNGFile.cxx and I see:
else if (modestr == "RECREATE") mode = OpenFlags::Delete;
If I add OpenFlags::Update
to the open mode, “RECREATE” works fine, and I can write to the file.
Is there a bug, or am I misunderstanding something?