File.new using File::CREAT should imply reading, not writing
------------------------------------------------------------
Key: JRUBY-1308
URL: http://jira.codehaus.org/browse/JRUBY-1308
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.0.1
Reporter: Johannes Sasongko
$ touch tmp
$ ruby -e "File.new('tmp', File::CREAT).read(1)"
$ jruby -e "File.new('tmp', File::CREAT).read(1)"
:1: not opened for reading (IOError)
$ ruby -e "File.new('tmp', File::CREAT) << 'a'"
-e:1:in `write': not opened for writing (IOError)
from -e:1:in `<<'
from -e:1
$ jruby -e "File.new('tmp', File::CREAT) << 'b'"
$ cat tmp
b
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email