TFile opening symbolic links

Dear ROOTers,

I’m opening a TFile to a symbolic link:
TFile* f = new TFile(“symbolic_link.root”,“READ”);

f->Get("path/h_thing)->Draw();

Of course, this works fine, providing symbolic_link.root points to a valid root file.
ls -l symbolic_link.root
symbolic_link.root -> valid_root_file.root

However, after the TFile() open, changing the symbolic link to point away, or deleting it, makes the second call fail!

I don’t understand how this can happen. Inside TFile, it calls SysOpen which is a wrapper for open(). The standard POSIX open() call returns a file descriptor to a file inode, so as long as TFile doesn’t attempt to re-open the file by filename, it should be able to read it fine!

I’m getting very frustrated: this means I can’t use a dynamically-changing symlink for anything in ROOT, even if the original file stays valid! Is there any way of overriding, or at least explaining this behaviour?

–Nathaniel

Hi Nathaniel,

I am unable to reproduce this problem. How does the call fails when it fails?

Philippe.