Bug #3227: tempfile.rb seems to have a broken unlink function
http://redmine.ruby-lang.org/issues/show/3227

Author: Diego E. Pettenò
Status: Open, Priority: Normal
ruby -v: ruby 1.9.1p376 (2009-12-07 revision 26041) [x86_64-linux]

When using tempfile on Ruby 1.8, unlink does not close the underlying file, which is useful on POSIX systems to stop other processes from accessing the temporary files. Similar suggestion is available in the comments for Tempfile#unlink on Ruby 1.9's tempfile.rb but there, the file gets _closed_ before being unlinked, and thus you cannot access it any more.

I'm not sure if the change in behaviour is wanted or not, but this at least seems to break Rack (from which I extracted the attached testcase). Either the suggestions should go, or it shouldn't close.


----------------------------------------
http://redmine.ruby-lang.org