diff options
Diffstat (limited to 'lib/tempfile.rb')
-rw-r--r-- | lib/tempfile.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb index c432285309..0e4c99e5ff 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) |