Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: JRuby 1.7.0.RC1
    • Component/s: None
    • Labels:
      None
    • Patch Submitted:
      Yes
    • Number of attachments :
      3

      Description

      Hello,

      I've been noticing File.readlink does not work well when changing cwd.
      I poked around and with #3300 and understood there was a missing file() call.

      I also moved the File.exist? test since readlink should succeed even if the target does not exists (File.read? link will return false in this case, even if the link actually exists).

      The failure I observed was an NPE, because null was passed to newString().
      I used runtime.newErrnoFromLastPOSIXErrno() but I'm not sure if it's appropriate (what's JNA3?).

      Where should I add the tests? RubySpec? JRuby's tests?

        Activity

        Hide
        Benoit Daloze added a comment -

        Also passing the old and new readlink_spec.rb of RubySpec.

        Unfortunately I can't seem to run "rake test:mri19" fully (Interrupt: interrupt a dead condition variable; test_condvar_wait_exception_handling at .../jruby/test/externals/ruby1.9/ruby/test_thread.rb:88) nor "rake spec:ci_interpreted_19" (rubyspec repo found: `git checkout -q b8ddfd570c0da45fe924d9bc7ff2c9ec32413ffe` repo at spec/ruby
        git checkout -q b8ddfd570c0da45fe924d9bc7ff2c9ec32413ffe
        fatal: reference is not a tree: b8ddfd570c0da45fe924d9bc7ff2c9ec32413ffe).

        Show
        Benoit Daloze added a comment - Also passing the old and new readlink_spec.rb of RubySpec. Unfortunately I can't seem to run "rake test:mri19" fully (Interrupt: interrupt a dead condition variable; test_condvar_wait_exception_handling at .../jruby/test/externals/ruby1.9/ruby/test_thread.rb:88) nor "rake spec:ci_interpreted_19" (rubyspec repo found: `git checkout -q b8ddfd570c0da45fe924d9bc7ff2c9ec32413ffe` repo at spec/ruby git checkout -q b8ddfd570c0da45fe924d9bc7ff2c9ec32413ffe fatal: reference is not a tree: b8ddfd570c0da45fe924d9bc7ff2c9ec32413ffe).
        Hide
        Benoit Daloze added a comment -

        Seems there was some submodule mess. I rebased on master and "rake test:mri19" passes.

        Show
        Benoit Daloze added a comment - Seems there was some submodule mess. I rebased on master and "rake test:mri19" passes.
        Hide
        Benoit Daloze added a comment -

        Rebased patch

        Show
        Benoit Daloze added a comment - Rebased patch
        Hide
        Benoit Daloze added a comment -

        Sorry about that by the way, I thought I tested with 1.9 tests too.

        Show
        Benoit Daloze added a comment - Sorry about that by the way, I thought I tested with 1.9 tests too.
        Hide
        Charles Oliver Nutter added a comment -

        Thank you for the patch!

        commit 89ed6b777f5cc8e3be9d348d4d7d460665ba6ae5
        Author: Charles Oliver Nutter <headius@headius.com>
        Date:   Fri Sep 7 11:23:45 2012 -0500
        
            Fix JRUBY-6578: File.readlink with chdir
            
            Patch by Benoit Daloze <eregontp@gmail.com>
        
        :100644 100644 2dca84b... 8f4c089... M	src/org/jruby/RubyFile.java
        
        Show
        Charles Oliver Nutter added a comment - Thank you for the patch! commit 89ed6b777f5cc8e3be9d348d4d7d460665ba6ae5 Author: Charles Oliver Nutter <headius@headius.com> Date: Fri Sep 7 11:23:45 2012 -0500 Fix JRUBY-6578: File.readlink with chdir Patch by Benoit Daloze <eregontp@gmail.com> :100644 100644 2dca84b... 8f4c089... M src/org/jruby/RubyFile.java

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Benoit Daloze
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: