Print out dir structure inside a root file in a tree-form

Hi, experts

I have searched a lot but still cannot find what I am looking for.

I have naive question on how to dump the content of a root file in a tree-form. Like the linux command, tree, is there any similar tool?

I find a tool called rootls. But seems that it will display in a traditional file->ls() style.

Many thanks in advance.


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Maybe @sbinet has some tool.

groot’s command line tool cmd/root-ls won’t display the “fancy” tree lines that tree(1) would but… (pull requests accepted :P):

$> root-ls ./testdata/dirs-6.14.00.root 
=== [./testdata/dirs-6.14.00.root] ===
version: 61400
TDirectoryFile   dir1    dir1    (cycle=1)
  TDirectoryFile dir11   dir11   (cycle=1)
    TH1F         h1      h1      (cycle=1)
TDirectoryFile dir2    dir2    (cycle=1)
TDirectoryFile dir3    dir3    (cycle=1)

let me know,
-s


you can get it like so (with a Go environment):

$> go get go-hep.org/x/hep/groot/cmd/root-ls

or download the binary for your platform+OS, there:

1 Like