title: ruby Temporary files inside temporary directory
body: <p>I want to create temporary files inside temporary directory. below is my code for this.</p>
  
  <pre><code>           require 'tmpdir'
             require 'tempfile'
             Dir.mktmpdir do |dir|
               Dir.chdir(dir)
               TemFile.new("f")
               sleep 20
             end
  </code></pre>
  
  <p>It gives me this exception:
  <code>Errno::EACCES: Permission denied - C:/Users/SANJAY~1/AppData/Local/Temp/d20130724-5600-ka2ame</code> , because ruby is trying to delete a temp directory, which is not empty.</p>
  
  <p>Please help me to create a temp file inside temp directory.</p>