Re: [ROOT] TMapFile + TFile ?

From: Colin Bernet (bernet@kph.uni-mainz.de)
Date: Thu Jul 27 2000 - 13:26:23 MEST


Hi  Otto,

If I do that (which is by the way not specified in the tutorial), the mem
mapped file is created without any error message about the shadow file. Yet
when I try to look at it in root by doing :

mfile=TMapFile::Create("monitor.map")

I get a recurrent segmentation fault.
I think there is a problem here, cause this program works well with root
2.22/10

Does anybody have a clue ?

Thanks,
    Colin


Otto Schaile wrote:

> On Wed, 26 Jul 2000, Colin Bernet wrote:
>
> Hi Colin,
> add  mfile->Close() as indicated and it should work,
>
> Cheers
> Otto
>
> > Dear rooters,
> >
> > I would like to create a TMapFile and a TFile in the same application,
> > but it doesn't seem to work. This program reproduces the problem :
> >
> > #include "TROOT.h"
> > #include "TMapFile.h"
> > #include "TFile.h"
> > #include "TH1.h"
> >
> > int main(){
> >
> >   TROOT simple("simple","Example of creation of a tree");
> >
> >   TFile *file=new TFile("nt.root","recreate");
> >
> >   TMapFile *mfile = TMapFile::Create("monitor.map","RECREATE", 100000,
> >         "memory mapped file for monitoring");
> >
> >   TH1F h("h","h",1,0,1);
> >
> >   mfile->Update();
> >
> >   file->cd();
> >   h.Write();
> >   file->Close();
>
>     mfile->Close(); //  <<<<<<<<<<<<<<<<<<  add this
> >
> >   return 0;
> > }
> >
> >
>
> Dr. Otto Schaile            Sektion Physik, LMU Muenchen
> Phone: +49 89 289 14070     Am Coulombwall 1, D-85748 Garching, Germany
> GSM:   +49 171 4312031
> FAX:   +49 89 289 14072     EMail: Otto.Schaile@Physik.Uni-Muenchen.DE



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:30 MET