Previous Reductive Labs, LLC Next

Blocks: Filehandle cleanup

file = "/tmp/testing"

File.open(file, 'w') do |fh|
    fh.puts "Some text"
end

puts (defined? fh).inspect

puts File.read(file)

Produces:

nil
Some text
Previous Luke Kanies luke@reductivelabs.com | Index Next