-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Labels
Milestone
Description
Looks like this broke between pre1 and pre2:
D:\>C:\jruby-9.0.0.0.pre1\bin\jruby -e "File.open('a.rb', 'a'){}; require './a.rb'; File.delete('a.rb'); p 1"
1
D:\>C:\jruby-9.0.0.0.pre2\bin\jruby -e "File.open('a.rb', 'a'){}; require './a.rb'; File.delete('a.rb'); p 1"
Errno::EACCES: Permission denied - a.rb
delete at org/jruby/RubyFile.java:1116
<top> at -e:1
D:\>C:\jruby-9.0.0.0.rc1\bin\jruby -e "File.open('a.rb', 'a'){}; require './a.rb'; File.delete('a.rb'); p 1"
Errno::EACCES: Permission denied - a.rb
delete at org/jruby/RubyFile.java:1116
<top> at -e:1
It doesn't matter if the a.rb file already exists or if the process creates it, trying to delete it after requiring it raises the error.
Found by running Sequel's specs.
I didn't test on a *nix, but it's unlikely to be a problem there as *nix allows deletion of files that are in use.
Reactions are currently unavailable