Skip to content

Instantly share code, notes, and snippets.

@taisyo7333
Created February 24, 2016 00:07
Show Gist options
  • Save taisyo7333/651bddd63d55bd4e0d8c to your computer and use it in GitHub Desktop.
Save taisyo7333/651bddd63d55bd4e0d8c to your computer and use it in GitHub Desktop.
ruby memo
Ruby 既存ファイルを開く時のモードについて
"w" : 書き込みモード:既存ファイルの場合は、ファイルの内容を空にする。
"w+": 読み書きモード:既存ファイルの場合は、ファイルの内容を空にする。
"r+": 読み書きモード:ファイルの読み書き位置が戦闘になる。
"a" : 追記モード  :常にファイルの末尾に追加
"a+": 読み書きモード:ファイルの読み込み位置は先頭。書き込み位置は常に末尾。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment