Re: [ROOT] Error detection for TFile

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Nov 10 2000 - 15:22:42 MET


Hi,
You can test if a file has a valid keys structure with:

  TFile f("myfile.root");
  if (f.GetSeekKeys() <= 0) printf("something is wrong\n");

Rene Brun

Haitao Liu wrote:
> 
> Dear rooters,
> 
> I used Root for simulation on a PC farm contains hundreds of process, so
> hundreds of files are produced every day. Sometimes, one of the TFile was
> corrupted for some reason( disk full). When my program try to read the object,
> use TFile::Get(), I get segmentation fault. The File can be opened but it
> issue error message. So how can I judge the file is corrupted before I get
> egmentation fault. I think I get some error status from TFile, but I can not
> find.
> 
> Thanks with regards                     Haitao



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