diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-06-01 06:59:20 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-06-01 06:59:20 +0000 |
commit | 2996504623d83ecb5620e7660e871a98aa9771e4 (patch) | |
tree | 1223800adb282895acdbc71d182e9f1d37ec9d6b /lib | |
parent | 8a4cbc733114d0a51bc324b466764d10985cbd80 (diff) |
rb_exec_end_proc, etc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tempfile.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb index ed376a5032..3fb7ff23d5 100644 --- a/lib/tempfile.rb +++ b/lib/tempfile.rb @@ -38,7 +38,7 @@ class Tempfile < SimpleDelegator tmpdir ||= ENV['TMPDIR'] || ENV['TMP'] || ENV['TEMP'] || '/tmp' tmpname = sprintf('%s/%s.%d.%d', tmpdir, basename, $$, n) lock = tmpname + '.lock' - unless File.exist?(lock) + unless File.exist?(tmpname) or File.exist?(lock) Dir.mkdir(lock) break end @@ -79,6 +79,10 @@ class Tempfile < SimpleDelegator ObjectSpace.undefine_finalizer(self) end end + + def path + @tmpname + end end if __FILE__ == $0 |