Re: Fwd: TFile::Open(): distinguish application level and filesystem level errors

From: Konstantin Olchanski <olchansk_at_triumf.ca>
Date: Wed, 16 Feb 2011 12:09:07 -0800


On Wed, Feb 16, 2011 at 07:57:13PM +0100, Thiemo Nagel wrote:
>
> TFile *f = new TFile( argv[1] );
> if ( f->IsZombie() )
> return 2;
> else
> return 0;

> }

You can also cheat:

{

   errno = 0;
   TFile *f = new TFile( argv[1] );
   if (errno != 0)

      printf("system error %d (%s) somewhere inside TFile::Open", errno, strerror(errno)); }

-- 
Konstantin Olchanski
Data Acquisition Systems: The Bytes Must Flow!
Email: olchansk-at-triumf-dot-ca
Snail mail: 4004 Wesbrook Mall, TRIUMF, Vancouver, B.C., V6T 2A3, Canada
Received on Wed Feb 16 2011 - 21:09:15 CET

This archive was generated by hypermail 2.2.0 : Thu Feb 17 2011 - 11:50:01 CET