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
File::Stat#directory? returns false for symlink to directory with trailing slash #5539
Milestone
Comments
I managed to narrow it down to the discrepancy in require "tmpdir"
require "fileutils"
source_path = "#{Dir.tmpdir}/foo"
link_path = "#{Dir.tmpdir}/foo-symlink"
FileUtils.mkdir_p(source_path)
FileUtils.ln_s(source_path, link_path, force: true)
puts File.lstat(link_path).directory?
puts File.lstat("#{link_path}/").directory? outputs on MRI:
but on JRuby it outputs:
|
Thanks for narrowing down the issue. I could reproduce this issue in the master branch with MacOS (10.13.3) and with Linux (Debian unstable). |
nomadium
added a commit
to nomadium/jruby
that referenced
this issue
Jan 14, 2019
janko
added a commit
to shrinerb/shrine
that referenced
this issue
Feb 4, 2019
I've reported this issue in jruby/jruby#5539, so all we can do is wait until it's resolved.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Expected behaviour
In MRI, when a
Pathname
instance points to a symlink,Pathname#find
will follow the symlink if you add a trailing slash. To illustrate, this script:will output the following on MRI:
Actual behaviour
JRuby won't follow the symlink on trailing slash:
The text was updated successfully, but these errors were encountered: