Project

General

Profile

Actions

Feature #6399

closed

IO.read ignores valid open_args on Windows

Feature #6399: IO.read ignores valid open_args on Windows

Added by djberg96 (Daniel Berger) over 13 years ago. Updated almost 8 years ago.

Status:
Feedback
Target version:
-
[ruby-core:44860]

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.

Updated by djberg96 (Daniel Berger) over 13 years ago Actions #1 [ruby-core:44861]

Grr, should be "open_args".

Updated by nobu (Nobuyoshi Nakada) over 13 years ago Actions #2 [ruby-core:44862]

  • 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

Updated by nobu (Nobuyoshi Nakada) over 13 years ago Actions #3 [ruby-core:44863]

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

Updated by mame (Yusuke Endoh) over 13 years ago Actions #4 [ruby-core:44867]

  • Status changed from Open to Assigned
  • Assignee set to usa (Usaku NAKAMURA)

Updated by usa (Usaku NAKAMURA) over 13 years ago Actions #5 [ruby-core:44920]

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.

Updated by usa (Usaku NAKAMURA) almost 13 years ago Actions #6 [ruby-core:48641]

  • Category set to core
  • Target version set to 2.6

Updated by usa (Usaku NAKAMURA) about 8 years ago Actions #7

  • Status changed from Assigned to Feedback

Updated by naruse (Yui NARUSE) almost 8 years ago Actions #8

  • Target version deleted (2.6)
Actions

Also available in: PDF Atom