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
15 super("#{Dir::tmpdir}/#{rand}", RDWR|CREAT|EXCL, 0600)
25 # for easier env["rack.input"] compatibility with Rack <= 1.1
28 end unless File.method_defined?(:size)