Roger P. wrote in post #999326:
mode: file mode. a string or an integer
The last line there seems to explain why you are getting the error.
Although, you aren’t supplying a numeric file descriptor either, so
File::WRONLY|File::TRUNC|File::CREAT is numeric…
- That isn’t a “file descriptor”, and
- What does the last line of the docs I posted say?
opt: hash for specifying mode by name.
Or, are you having trouble with the distribution of arguments to the
def do_stuff(a, b=“hello”, c)
do_stuff(10, :x => ‘goodbye’)
Although, you aren’t supplying a numeric file descriptor either,
so who knows.
points out that according to the docs, you can’t supply a string as the
first argument, which isn’t true. Therefore, when the docs say that the
‘opt’ parameter must be a hash with a key called :mode, which specifies
a name (not an integer), the docs may be wrong about that too(although
your error would indicate otherwise).