".ls()" freezes ROOT when the “current directory” is in a file

I tried to execute “.ls()” (the “()” is there due to a mistake, of course).

If this command is tried when a file is open and is the “current directory”, ROOT will *freeze". It does not even respond to “Ctrl-C” nor “Ctrl-Z” (in a Linux terminal). One needs to open another terminal window and kill this ROOT process from there.

[...]$ root hsimple.root
root [0]
Attaching file hsimple.root as _file0...
(TFile *) 0x55d254465df0
root [1] .ls()
TFile**         hsimple.root    Demo ROOT file with histograms
 TFile*         hsimple.root    Demo ROOT file with histograms
(... nothing works here ...)

There is no such problem when “gDirectory == gROOT” (“gFile” can be anything).

1 Like

@pcanal can maybe comment on this.

Note that the () are spurious (and it works properly without it). I am checking why it fails with the ()

Alright. When adding characters after the .ls those characters are passed to TFile::ls to be used as a pattern to match.

The problem you see happens to have been recently solved at:



This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.