Where is the call to Tempfile.new in this code?

At the following URL

There is the following code

require ‘ftools’
require ‘tempfile’

def compete who, f
5.times do |i|
f.flock File::LOCK_EX
f.puts format("%s:%d @ %f\n",who, i, Time.now.to_f)
f.flock File::LOCK_UN

path = format(FILE + ‘.out’)
fd = open(path, File::WRONLY | File::TRUNC | File::CREAT)

if fork
compete ‘PARENT’, fd

Process.wait rescue nil
open(path){|f| puts f.read}
File.rm_f path if File.exist? path

compete ‘CHILD’, fd

The code runs on my system. But, I don’t see any call to Tempfile.new.
I’m assuming it’s implied? If it is being implied, where is it being
implied at in the code?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs