Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dir.entries inconsistency with MRI (ENOTDIR vs ENOENT) #3840

Closed
e2 opened this issue May 2, 2016 · 3 comments
Closed

Dir.entries inconsistency with MRI (ENOTDIR vs ENOENT) #3840

e2 opened this issue May 2, 2016 · 3 comments

Comments

@e2
Copy link

e2 commented May 2, 2016

Environment

Inconsistency present on at least head and 9.0.5.0:

  • jruby 9.1.0.0-SNAPSHOT (2.3.0) 2016-05-02 1d36c5d OpenJDK 64-Bit Server VM 24.95-b01 on 1.7.0_95-b00 +jit [linux-x86_64]
  • jruby 9.0.5.0 (2.2.3) 2016-01-26 7bee00d OpenJDK 64-Bit Server VM 24.95-b01 on 1.7.0_95-b00 +jit [linux-amd64]

Linux Machine002 4.2.0-35-lowlatency #40-Ubuntu SMP PREEMPT Tue Mar 15 23:25:22 UTC 2016 x86_64 x86_64 x86_64 GNU/Linu

Expected Behavior

On MRI (2.3.1) I get Errno::ENOTDIR:

$ ruby -e 'Dir.entries("/etc/fstab")'
-e:1:in `open': Not a directory @ dir_initialize - /etc/fstab (Errno::ENOTDIR)
    from -e:1:in `entries'
    from -e:1:in `<main>'

Actual Behavior

On JRuby I get Errno::ENOENT

 ruby -e 'Dir.entries("/etc/fstab")'                                     
Errno::ENOENT: No such file or directory - No such directory: /etc/fstab
  entries at org/jruby/RubyDir.java:264
    <top> at -e:1
@kares
Copy link
Member

kares commented Jan 18, 2017

same on 1.7.25 as well as 9.1.7.0 :

Errno::ENOENT: No such file or directory - No such directory: /etc/fstab
  entries at org/jruby/RubyDir.java:280
   (root) at -e:1

@coderhs
Copy link

coderhs commented Jul 1, 2017

Is this issue still open, I would like to give it a shot. If I could get some directions.

@kares
Copy link
Member

kares commented Jul 1, 2017

@coders likely yes. check in RubyDir.java for a entries method implementation (annotated with @JRubyMethod)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants