Imported tempfile.rb from 1.8.