File#symlink? returns false on broken symlinks
----------------------------------------------

                 Key: JRUBY-1919
                 URL: http://jira.codehaus.org/browse/JRUBY-1919
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1RC1
         Environment: Latest JRuby 1.1RC1 from trunk.
            Reporter: Vladimir Sizikov
         Attachments: file-symlink-p-on-broken-symlink.patch

Consider the following example:

{noformat}
# First, clean everything
`rm -f test-file link-to-test-file`

# Create the file
`touch test-file`

# Create the link
`ln -s test-file link-to-test-file`

# Make the link broken
`rm test-file`

# Main checks:
p File.exists?('link-to-test-file')
p File.symlink?('link-to-test-file')
{noformat}

On MRI, it prints:
false
true

On JRuby, it prints:
false
false

Basically, File#symlink? returns false on broken, but existing symlink.

This leads to some hard-to-understand failures, (even dependent on the 
execution order!) when running rubyspecs.

The proposed patch fixes the problem.

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