Re: [ROOT] deleting, tfiles, and ttrees (Oh my!)

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Apr 09 2002 - 18:14:14 MEST


Hi Brandon,

To replace an object in a file, use the kOverwrite option.

Instead of
  obj.Write("name")
do
  obj.Write("name",TObject::kOverwrite);

Rene Brun

Brandon Kohn wrote:
> 
>    Part 1.1       Type: Plain Text (text/plain)
>               Encoding: quoted-printable
Hi Guys,

Got a little question here...

I have an application where I use a TFile as a sort of file system and store
various objects as 'files' within.  One of the requirements of this file system
is that I'm able to perform a destructive overwrite of a 'file' object in the
TFile without wiping out the entire TFile and recreating.  One of these 'file'
objects is a class the has a TTree* as a member.  I'm able to delete the object
fine, and it dissapears from the TFile when I do so.  However, in cases where I
delete the object and then create a new one with the same name (to simulate a
destructive overwrite), the size of the TFile is ~ double what it was before (in
this case it only has a single 'file' object.. so double that object's size).

So, the question is, what am I doing wrong?

Thanks as always!
Brandon Kohn
+377 97 97 41 51 ext. 306 (Work)
+377 97 77 86 71 (Home)
blk@maia-institute.org
The Maia Institute, Monaco



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:48 MET