In message <20020615184356.GE29645 / panoptic.com>
dossy / panoptic.com writes:

> This bug seems to have been fixed in 1.7.2:
> 
> $ umask 022
> $ rm -f foo
> $ ls -l foo
> /bin/ls: foo: No such file or directory
> $ ruby -ve 'File.new "foo", "w", 0600'
> ruby 1.6.7 (2002-03-19) [i386-linux]
> $ ls -l foo
> -rw-r--r--    1 dossy    users           0 Jun 15 14:43 foo
> 
> $ umask 022
> $ rm -f foo
> $ ls -l foo
> /bin/ls: foo: No such file or directory
> $ ruby-1.7.2 -ve 'File.new "foo", "w", 0600'
> ruby 1.7.2 (2002-05-30) [i686-linux]
> $ ls -l foo
> -rw-------    1 dossy    users           0 Jun 15 14:43 foo

That's not a bug but a new feature implemented in 1.7.x, IMO.  The
description of THE BOOK means following case:

    >ruby -e 'File.new("/tmp/foo", File::CREAT, 0600)
    >ls -l /tmp/foo
    -rw-------  1 kjana  wheel  0   6/16 12:10 /tmp/foo

namely open(2) system call like form.  This form should work on both
1.6.x and 1.7.x.

# Of course you can specify arbitrary mode allowed on your system.
# eg. File.new("/tmp/foo", File::CREAT|File::TRUNC|File::RDWR, 0600)


The feature recently requested has been adopted and implemented, but
not merged to the stable branch?


-- 
kjana / dm4lab.to                                  June 16, 2002
Of two evils choose the lesser.