Delete a tree

Dear all,

I have a root file with 4 trees and I would like to delete 2 of them from the file, could you tell me how to do it?
thanks
Emma

Hi Emma,
open the file in update mode (see http://root.cern.ch/root/html/TFile#TFile:TFile), and delete the objects from the file (see http://root.cern.ch/root/html/TFile#TFile:Delete):

TFile* f=new TFile("myfile.root","update"); f->Delete("mytree2;*"); delete f;
Axel.