[Rubyinstaller-devel] Bug in Ruby File#open

Luis Lavena luislavena at gmail.com
Thu Jun 5 19:24:49 EDT 2008

On Fri, Jun 6, 2008 at 12:58 AM, Gordon Thiesfeld <gthiesfeld at gmail.com> wrote:
> I've been running the rubyspecs[1] against Ruby 1.8.6 Mingw for the
> past few days, and I think I've found a bug in File#open.
>>> File.open('test'){} # create the file
> => nil
>>> File.open('test', File::TRUNC)
> Errno::EINVAL: Invalid argument - test
>        from (irb):3:in `initialize'
>        from (irb):3:in `open'
>        from (irb):3
> That doesn't happen on linux
> irb(main):002:0> File.open('test','w'){}
> => nil
> irb(main):003:0> File.open('test',File::TRUNC)
> => #<File:test>
> I'm hoping someone can point me in the right direction to track this
> down.  Bug submissions without patches attached don't seem to get
> fixed ;-)  I looked at file.c and io.c until my eyes bled, and
> couldn't make heads or tails.

Wow, did I miss a mail to ruby-core? (or was rubyforge tracker?)

Anyway, nice finding, replicated the same on both VC and MinGW builds,
1.8.5 and 1.8.6 code.

Just pinned this for work during lunch tomorrow, this is a tricky one
since File.open is actually calling IO.open (it's being included) --
will be hard but not impossible to track down.

Will let you know my findings!

Keep those bugs coming Gordon, I silently keep an eye on the
changesets feed for rubyspec and see all the great work you're doing!

Take care and talk tomorrow!
Luis Lavena
Human beings, who are almost unique in having the ability to learn from
the experience of others, are also remarkable for their apparent
disinclination to do so.
Douglas Adams

More information about the Rubyinstaller-devel mailing list