jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JRuby
  • JRUBY-2214

Pure-Java version of lstat doesn't fail on non-existing file

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.1RC2
  • Fix Version/s: JRuby 1.1
  • Component/s: Core Classes/Modules
  • Labels:
    None
  • Environment:
    JRuby 1.1RC2, Linux, Windows

Description

Pure Java lstat accepts non-existing files:

jruby -J-Djruby.native.enabled=false -e "p File.lstat('doesnt-exist').size"

But, with native:
jruby -J-Djruby.native.enabled=true -e "p File.lstat('doesnt-exist').size"
-e:1: No such file or directory - No such file or directory - /opt/work/jruby.git/doesnt-exist (Errno::ENOENT)

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Charles Oliver Nutter added a comment - 17/Mar/08 5:58 PM

I commited a partial fix for this, so that if a file/link is totally not there, it will raise an error. It does not, however, fix the case where it should be happy if there's a symlink that points at a non-existent file, where lstat should succeed with no error. Moving to 1.1+ for additional study and work on that case.

Show
Charles Oliver Nutter added a comment - 17/Mar/08 5:58 PM I commited a partial fix for this, so that if a file/link is totally not there, it will raise an error. It does not, however, fix the case where it should be happy if there's a symlink that points at a non-existent file, where lstat should succeed with no error. Moving to 1.1+ for additional study and work on that case.
Hide
Permalink
Charles Oliver Nutter added a comment - 04/Feb/09 3:40 AM

Retroactively marking as fixed. There's simply no way from Java to determine that a symlink exists but the file it references does not. We can only go with the simple result that Java gives us. Ultimately, the fix that was in 1.1 is the best we can do for now.

Show
Charles Oliver Nutter added a comment - 04/Feb/09 3:40 AM Retroactively marking as fixed. There's simply no way from Java to determine that a symlink exists but the file it references does not. We can only go with the simple result that Java gives us. Ultimately, the fix that was in 1.1 is the best we can do for now.

People

  • Assignee:
    Charles Oliver Nutter
    Reporter:
    Vladimir Sizikov
Vote (0)
Watch (1)

Dates

  • Created:
    02/Mar/08 5:24 PM
    Updated:
    21/Mar/09 1:14 PM
    Resolved:
    04/Feb/09 3:40 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.