2008-02-20から1日間の記事一覧

ファイル I/O

第二引数に指定されたファイルから読んで、第三引数に指定されたファイルに書く (Append) lesson005.rb dummy, source, target = ARGVopen(source, 'r') do |s| open(target, 'a') do |t| s.each do |line| t.puts line end end end実行結果 C:\>ruby c:\stu…