Issue #6399 has been updated by djberg96 (Daniel Berger).


Grr, should be "open_args".
----------------------------------------
Bug #6399: IO.read ignores valid command_args on Windows
https://bugs.ruby-lang.org/issues/6399#change-26434

Author: djberg96 (Daniel Berger)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [i386-mswin32_100]


On Microsoft Windows the fopen function accepts many more modes than the standard function:

http://msdn.microsoft.com/en-us/library/yeby3zcb(v=vs.80).aspx

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.


-- 
http://bugs.ruby-lang.org/