summaryrefslogtreecommitdiff
path: root/lib/tempfile.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-06 07:21:26 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-06 07:21:26 +0000
commitd1375688cdde3d094984f7f3a7bffe57306a0bca (patch)
treef5320945b9bfd9fc19b133335a7be45076fe03e9 /lib/tempfile.rb
parenta60db057a2a8456f8f5b59a6c5805e25d1d47d34 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/tempfile.rb')
-rw-r--r--lib/tempfile.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index c432285..0e4c99e 100644
--- a/lib/tempfile.rb
+++ b/lib/tempfile.rb
@@ -52,7 +52,7 @@ class Tempfile < SimpleDelegator
@clean_files = Tempfile.callback(tmpname, @protect)
ObjectSpace.define_finalizer(self, @clean_files)
- @tmpfile = File.open(tmpname, 'w+')
+ @tmpfile = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL)
@protect[0] = @tmpfile
@tmpname = tmpname
super(@tmpfile)