title: Ruby auto deleting temp file?
body: <p>I'm confused. Here's my code:</p>
  
  <pre><code>require 'csv'                                                               
  require 'tempfile'                                                          
  
  f = Tempfile.new('csv','/tmp')                                                 
  f.write 'just wanna test'                                                       
  f.close                                                                        
  
  p f.path 
  </code></pre>
  
  <p>If I open the output path, it is empty.</p>
  
  <p>I think this is because that the TempFile got automatically removed from the file system each time the ruby session exits. However, how do I know exactly when the file got deleted? Because I'm thinking to use it to create temp file within my rails app, I'm afraid if the file got deleted before it is used.</p>