diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-01-26 05:02:19 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-01-26 05:02:19 +0000 |
commit | 78ddee596259ca964c5540c38eab3e28f5ef82e3 (patch) | |
tree | 44b4f063df201d6c550a491323543f80fd4a25df /lib | |
parent | 5c2f80312225762a1e1aad7becb85326756e72f3 (diff) | |
download | ruby-78ddee596259ca964c5540c38eab3e28f5ef82e3.tar.gz ruby-78ddee596259ca964c5540c38eab3e28f5ef82e3.tar.xz ruby-78ddee596259ca964c5540c38eab3e28f5ef82e3.zip |
* parse.y: clarify do ambiguity, bit more complex but natural
from my point of view.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tempfile.rb | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb index ab97f457a..0b22de260 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 |