Cannot unlink broken symlink via Pathname
-----------------------------------------

                 Key: JRUBY-6099
                 URL: https://jira.codehaus.org/browse/JRUBY-6099
             Project: JRuby
          Issue Type: Bug
          Components: Standard Library
    Affects Versions: JRuby 1.6.2
         Environment: Mac OS X 10.6.8 
            Reporter: Joern Barthel
            Assignee: Thomas E Enebo


When swapping the last two lines it works as expected.

{code}

require 'fileutils'
require 'pathname'

source = Pathname.new('test')
FileUtils.touch source

raise unless source.exist?

link = Pathname.new('link')
link.make_symlink source

raise unless link.exist?
raise unless link.symlink?

source.unlink
link.unlink
{code}

The exception is:

{noformat}
Errno::ENOENT: No such file or directory - No such file or directory - link
   rmdir at org/jruby/RubyDir.java:363
  unlink at /Users/.../.rvm/rubies/jruby-1.6.2/lib/ruby/1.8/pathname.rb:1058
  (root) at symlink-bug.rb:16
{noformat}

--
This message is automatically generated by JIRA.
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