Create a folder in a root file

Hi everyone,
I want to create a folder inside of a root file, so that when I browse the file, I see several folders, which contain files.
This probably has an extremely simple solution, but I can’t seem to find the right command.
Thanks,
Emil

1 Like
root [0] auto f = new TFile("bla.root","Recreate");
root [1] f->ls()
TFile**		bla.root	
 TFile*		bla.root	
root [2] f->mkdir("foo")
(TDirectory *) 0x7f8925f5ad20
root [3] f->ls()
TFile**		bla.root	
 TFile*		bla.root	
  TDirectoryFile*		foo	foo
  KEY: TDirectoryFile	foo;1	foo
root [4] 

1 Like