Project

General

Profile

Actions

Feature #6399

closed

IO.read ignores valid open_args on Windows

Added by djberg96 (Daniel Berger) almost 12 years ago. Updated over 6 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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0