Feature #6399

IO.read ignores valid open_args on Windows

Added by Daniel Berger about 3 years ago. Updated over 2 years ago.

[ruby-core:44860]
Status:Assigned
Priority:Normal
Assignee:Usaku NAKAMURA

Description

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.

History

#1 Updated by Daniel Berger about 3 years ago

Grr, should be "open_args".

#2 Updated by Nobuyoshi Nakada about 3 years ago

  • 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

#3 Updated by Nobuyoshi Nakada about 3 years ago

Of course, you mean "valid on Windows", I guess.

#4 Updated by Yusuke Endoh about 3 years ago

  • Assignee set to Usaku NAKAMURA
  • Status changed from Open to Assigned

#5 Updated by Usaku NAKAMURA about 3 years ago

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.

#6 Updated by Usaku NAKAMURA over 2 years ago

  • Category set to core
  • Target version set to next minor

Also available in: Atom PDF