#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

file = File.open("sample.txt","r")

puts(file.read)
file.close

file = File.open("sample.txt","w")

file.write("書き込み")
file.close

file = File.open("sample.txt","a")

file.write("追記しました")
file.close

file = File.open("sample.txt","r")

puts(file.read)
file.close
