Project

General

Profile

Actions

Feature #4742

closed

Allow for File.open('yo', :mode => File::WRONLY|File::TRUNC|File::CREAT)

Added by rogerdpack (Roger Pack) over 13 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
[ruby-core:36338]

Description

Currently we have these options for File.open:

File.open('yo', 'w')
File.open('yo', File::WRONLY|File::TRUNC|File::CREAT)
File.open('yo', :mode => 'w')

but not
File.open('yo', :mode => File::WRONLY|File::TRUNC|File::CREAT)

Which seemed a bit surprising to me, so making a feature request for it.
Cheers!
-roger-

Actions #1

Updated by nobu (Nobuyoshi Nakada) over 13 years ago

  • Tracker changed from Bug to Feature
Actions #2

Updated by kosaki (Motohiro KOSAKI) over 13 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r31671.
Roger, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • io.c (rb_io_extract_modeenc): accept combination hash and
    File::Constants. (eg. File.open('yo', :mode => File::WRONLY))
    [Feature #4742][ruby-core:36338]
  • test/ruby/test_io.rb (TestIO#test_open_mode): new test.

Updated by kosaki (Motohiro KOSAKI) over 13 years ago

  • Category set to core
  • Assignee set to kosaki (Motohiro KOSAKI)
  • Target version set to 1.9.3
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0