IO.read ignores valid open_args on Windows
On Microsoft Windows the fopen function accepts many more modes than the standard function:
However, Ruby 1.9 doesn't appear to allow them:
Try to force a sequential scan with 'S', for example¶
IO.read(file, open_args: ['rbS']) # => invalid access mode rbS (ArgumentError)
It looks like checks are being made manually in file.c and if they don't match the predetermined flags then an error is raised. I would submit that the flags should be allowed to be passed through, and fopen should fail on its own if they're invalid.
Grr, should be "open_args".
- Tracker changed from Bug to Feature
- Subject changed from IO.read ignores valid command_args on Windows to IO.read ignores valid open_args on Windows
Of course, you mean "valid on Windows", I guess.
- Status changed from Open to Assigned
- Assignee set to usa (Usaku NAKAMURA)
I do not think that Ruby must support such non standard modes.
But if you can provide a patch to support them in other platforms,
your request may get more persuasive.
- Category set to core
- Target version set to 2.6
- Status changed from Assigned to Feedback
- Target version deleted (
Also available in: Atom