summaryrefslogtreecommitdiff
path: root/lib/tempfile.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-01-26 05:02:19 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-01-26 05:02:19 +0000
commit161e3313d20eb285c8cfc3288e92a6d2e533cf44 (patch)
tree44b4f063df201d6c550a491323543f80fd4a25df /lib/tempfile.rb
parent74273daffb0d9f1b17795c8b8bbe8e32e14229eb (diff)
* parse.y: clarify do ambiguity, bit more complex but natural
from my point of view. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/tempfile.rb')
-rw-r--r--lib/tempfile.rb19
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index ab97f45..0b22de2 100644
--- a/lib/tempfile.rb
+++ b/lib/tempfile.rb
@@ -15,16 +15,19 @@ class Tempfile < SimpleDelegator
Max_try = 10
def Tempfile.callback(path, data)
+ pid = $$
lambda{
- print "removing ", path, "..." if $DEBUG
- data[0].close if data[0]
- if File.exist?(path)
- File.unlink(path)
- end
- if File.exist?(path + '.lock')
- Dir.rmdir(path + '.lock')
+ if pid == $$
+ print "removing ", path, "..." if $DEBUG
+ data[0].close if data[0]
+ if File.exist?(path)
+ File.unlink(path)
+ end
+ if File.exist?(path + '.lock')
+ Dir.rmdir(path + '.lock')
+ end
+ print "done\n" if $DEBUG
end
- print "done\n" if $DEBUG
}
end