# class Unicorn::TmpIO

some versions of Ruby had a broken Tempfile which didn't work well with unlinked files. This one is much shorter, easier to understand, and slightly faster.

### Public Class Methods

new() click to toggle source

creates and returns a new File object. The File is unlinked immediately, switched to binary mode, and userspace output buffering is disabled

Calls superclass method

    # File lib/unicorn/tmpio.rb, line 12
    def self.new
      fp = begin
        super("#{Dir::tmpdir}/#{rand}", RDWR|CREAT|EXCL, 0600)
      rescue Errno::EEXIST
        retry
      end
      unlink(fp.path)
      fp.binmode
      fp.sync = true
      fp
    end

### Public Instance Methods

size() click to toggle source

for easier env compatibility with Rack <= 1.1

    # File lib/unicorn/tmpio.rb, line 25
    def size
      stat.size
    end