1 # -*- encoding: binary -*-
5 # some versions of Ruby had a broken Tempfile which didn't work
6 # well with unlinked files. This one is much shorter, easier
7 # to understand, and slightly faster.
8 class Unicorn::TmpIO < File
10 # creates and returns a new File object. The File is unlinked
11 # immediately, switched to binary mode, and userspace output
12 # buffering is disabled
16 # workaround File#path being tainted:
17 # https://bugs.ruby-lang.org/issues/14485
19 path = "#{Dir::tmpdir}/#{rand}"
20 super(path, RDWR|CREAT|EXCL, 0600)
31 # pretend we're Tempfile for Rack::TempfileReaper