Skip to content

Instantly share code, notes, and snippets.

@amatsuda
Created July 15, 2011 06:51
Show Gist options
  • Save amatsuda/1084216 to your computer and use it in GitHub Desktop.
Save amatsuda/1084216 to your computer and use it in GitHub Desktop.
require 'tempfile'
t1 = Tempfile.new 'foo.txt'
t2 = t1.dup
t1 = nil
GC.start
p File.exists?(t2.path)
p t2.read
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment