Project

General

Profile

Actions

Backport #3227

closed

tempfile.rb seems to have a broken unlink function

Added by Flameeyes (Diego Elio Pettenò) almost 14 years ago. Updated over 4 years ago.

Status:
Closed
Assignee:
-
[ruby-core:29905]

Description

=begin
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.
=end


Files

tempfile-unlink-tcase.rb (220 Bytes) tempfile-unlink-tcase.rb Testcase derived by rack-1.1.0 Flameeyes (Diego Elio Pettenò), 05/01/2010 04:59 AM
Actions #1

Updated by coatl (caleb clausen) almost 14 years ago

=begin
I just want to be clear on what you mean; you're saying the Tempfile should still be usable (not closed) after Tempfile#unlink has been called, right?

Works for me using a 1.9.2dev build from 2010-04-24 (6 days ago). Maybe something needs to be backported to 1.9.1?
=end

Actions #2

Updated by mame (Yusuke Endoh) almost 14 years ago

  • Target version set to 1.9.1

=begin
Hi,

I think Caleb is right.
r24662 should be merged into ruby_1_9_1.

This ticket is moved to Backport tracker. Thanks.

--
Yusuke Endoh
=end

Actions #3

Updated by jeremyevans0 (Jeremy Evans) over 4 years ago

  • Description updated (diff)
  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0