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

From: Tom Roberts <tjrob_at_fnal.gov>
Date: Thu, 17 Feb 2011 10:30:04 -0600


It's worse -- TFile::IsZombie() also checks for being a valid TFile, while errno cannot do that. (I forgot to mention this in my previous note; sorry.)

Tom Roberts

On 2/17/11 2/17/11 - 10:24 AM, Konstantin Olchanski wrote:
> On Thu, Feb 17, 2011 at 10:17:22AM -0600, Tom Roberts wrote:
>> No, the code quoted below does not work -- the errno it references does not
>> change:
>>
>> root [2] errno=0
>> Warning: Automatic variable errno is allocated (tmpfile):1:
>> (const int)0
>> root [3] f1=new TFile("g4beamline.root") // file exists
>> (class TFile*)0x254ede0
>> root [4] errno
>> (int)0
>
> Thanks for the info. I do not expect the "errno" cheat to work in the CINT
> environement anyway, because CINT may be making syscalls itself
> and some of them may clear "errno" after it is set inside TFile().
>
> But should have worked for compiled code. (And my example was for compiled code).
>
Received on Thu Feb 17 2011 - 17:30:09 CET

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