rubyのfile openオプション

よく忘れるので、ここにメモるぞ

File.open(file name,option)
open(file name,option)

r: 既存のファイルを読み込み専用で
r+: 既存のファイルを読み書き両用で
w: 新規のファイルを書き込み専用で
w+: 新規のファイルを読み書き両用で
a: 新規/既存のファイルを追加書き込み専用で
a+: 新規/既存のファイルを追加書き込み/読み込み両用で

ref.
https://sites.google.com/site/rubycocoamemo/Home/ruby-guan-lian/file-dumi-shuki