in reply to Testing for O_RDONLY

if( ($flag & (O_RDONLY|O_WRONLY|O_RDWR)) == O_RDONLY ){ "r" }

Replies are listed 'Best First'.
Re: Re: Testing for O_RDONLY
by Anonymous Monk on Feb 01, 2001 at 00:40 UTC
    turn all the bits on and then check... that totally makes sense... thx