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.
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-
- Tracker changed from Bug to Feature
- 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.
- Category set to core
- Assignee set to kosaki (Motohiro KOSAKI)
- Target version set to 1.9.3
Also available in: Atom
PDF
Like0
Like0Like0Like0