Re: find object help

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Feb 19 1997 - 12:12:47 MET


Jacek M. Holeczek wrote:
> 
> > > Still nobody answered whether I am able to RECOVER the LAST USED RAM
> > > DIRECTORY. Is there any trick available.
> >
> > gDirectory points to the current directory (what you call LAST path
> > in memory).
> Thanks, but the gDirectory is not what I really mean by the LAST USED RAM
> DIRECTORY. Initially it points to gROOT. Then, when you create some
> subdirectories and cd() to them, the gDirectory "follows" you, but, for
> example, if one opens a file the gDirectory will switch to it. Thus what I
> mean is ( probably ) the last used subdirectory before you opened the
> file. I don't know how to describe it well, but I mean the difference
> between gROOT->ls() and gDirectory->ls() after you opened a file.
> The gROOT->ls() gives me "pure" ram objects/subdirectories, while
> gDirectory->ls() gives me "mixed" file / ram objects ( I can't find the
> appropriate source code now, but there is somewhere a place where
> an option "m" lists all memory resident objects and "d" all disk
> resident objects in this case - if I understand it well, of course ).
> I would like to recover the subdirectory, one of these that are listed by
> gROOT->ls(), that was used most recently, in case the gDirectory points to
> an opened file.
> Jacek.

gDirectory->ls("m") lists only memory objects
gDirectory->ls("d") lists only disk objects
default is to list both.

gDirectory always points to the current directory.
It is your responsability to save what you call the LAST path
with a statement like
  TDirectory *dirsav = gDirectory;
and then dirsav->ls(), cd(), Get(..), etc.

Rene Brun



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:18 MET