File#open should not change permissions of existing file, even when permissions 
specified in arguments
------------------------------------------------------------------------------------------------------

                 Key: JRUBY-2096
                 URL: http://jira.codehaus.org/browse/JRUBY-2096
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1RC1
         Environment: Latest JRuby 1.1RC1
            Reporter: Vladimir Sizikov
            Assignee: Vladimir Sizikov
             Fix For: JRuby 1.1RC2


Here's a rubyspec that fails with JRuby:

{noformat}
  it "opens the existing file, does not change permissions even when they are 
specified" do
    File.chmod(0664, @file)           # r-w perms
    orig_perms = File.stat(@file).mode.to_s(8)
    File.open(@file, "w", 0444){ |f|  # r-o perms, but they should be ignored
      lambda { f.puts("test") }.should_not raise_error(IOError)
    }
    # check that original permissions preserved
    File.stat(@file).mode.to_s(8).should == orig_perms

    # it should be still possible to read from the file
    File.read(@file).should == "test\n"
  end
{noformat}

Fix is coming.


-- 
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


Reply via email to