On Tue, Dec 07, 2004 at 11:37:39AM +0900, nobu.nokada / softhome.net wrote:
> Hi,
> 
> At Tue, 7 Dec 2004 10:16:39 +0900,
> Jos Backus wrote in [ruby-core:03910]:
> > > "mode" feels confusing as "stat.mode", how about "accmode" instead?
> > 
> > I rather like the symmetry between File.mode and File::Stat.mode, but accmode
> > is okay with me too.
> 
> File::Stat.mode differs from what you are proposing.  It is the
> permission of a existing file, while yours is the mode which
> requested to open.
 
You are indeed correct. Confusing use of the word `mode'. `accmode' is the
better term here.

> You can just write as:
> 
> +    GetOpenFile(io, fptr);
> +    return rb_str_new2(rb_io_flags_mode(fptr->mode));

Thanks. I didn't know about rb_str_new2().

-- 
Jos Backus                       _/  _/_/_/      Sunnyvale, CA
                                _/  _/   _/
                               _/  _/_/_/
                          _/  _/  _/    _/
jos at catnook.com        _/_/   _/_/_/          require 'std/disclaimer'