Skip to content

Conversation

@katafrakt
Copy link
Contributor

This changes error message when doing FileUtils.rm on a non-existing file.

Ruby 3.4.1:

irb(main):005> FileUtils.rm("/tmp/blah")
/home/katafrakt/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/fileutils.rb:2332:in 'File.unlink': No such file or directory @ apply2files - /tmp/blah (Errno::ENOENT)
	from /home/katafrakt/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/fileutils.rb:2332:in 'block in FileUtils::Entry_#remove_file'

In JRuby 10.0.2.0:

irb(main):003> FileUtils.rm("/tmp/blah")
org/jruby/RubyFile.java:1218:in 'unlink': No such file or directory - No such file or directory (Errno::ENOENT)
	from /home/katafrakt/.local/share/mise/installs/ruby/jruby-10.0.2.0/lib/ruby/stdlib/fileutils.rb:2332:in 'block in remove_file'

After changes in this PR:

irb(main):001> FileUtils.rm("/tmp/blah")
org/jruby/RubyFile.java:1219:in 'unlink': No such file or directory - /tmp/blah (Errno::ENOENT)
	from /home/katafrakt/dev/github/jruby/lib/ruby/stdlib/fileutils.rb:2332:in 'block in remove_file'

@headius headius added this to the JRuby 10.0.3.0 milestone Dec 8, 2025
@headius
Copy link
Member

headius commented Dec 8, 2025

Simple fix, thanks!

@headius headius merged commit 0c09944 into jruby:master Dec 10, 2025
76 of 77 checks passed
@katafrakt katafrakt deleted the fileutils-error-msg branch December 10, 2025 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants