With no associated block, open is a synonym for IO.new.
===
IO.new(fd [, mode] [, opt]) → io
Returns a new IO object (a stream) for the given IO object or integer
file descriptor and mode string. See also IO.sysopen and IO.for_fd.
Parameters
fd: numeric file descriptor
mode: file mode. a string or an integer
opt: hash for specifying mode by name.
The last line there seems to be why you are getting the error.
I guess this is why. I just don't see quite *why* it requires mode by
name in opts, but accepts it by int when given as a parameter. But that
makes sense.
A few more notes.
IO.open(fd, mode_string="r" [, opt] ) → io
Yeah, interestingly, this doesn't look at all like
File.open('filename')
so...the docs just lack the most common usage of File.open apparently?
Odd.