Skip to content

Instantly share code, notes, and snippets.

@nuna
Created August 18, 2010 12:24
Show Gist options
  • Save nuna/534525 to your computer and use it in GitHub Desktop.
Save nuna/534525 to your computer and use it in GitHub Desktop.
require 'tempfile'
def tempwrite
f = Tempfile.new('temp')
f.puts 'nihanihanihanihatorigairu'
f.close
return f.path
end
path = tempwrite
GC.start
File.open(path) do |f|
puts f.gets
end
#=> Errno::ENOENT: No such file or directory - /tmp/tempYYYYMMDD-xxxxx-xxxxxxx-0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment