2013-07-20から1日間の記事一覧
File.open("foo.txt", "r") do |io| while ! io.eof? print io.read(1) io.seek(1, IO::SEEK_END) # io.seek(1, IO::SEEK_CUR) # io.seek(1) io.seek(1, IO::SEEK_SET) # デフォルトなので上のなにもオプションがないのと同じ end end File.open("foo.txt", …
File.open("foo.txt", "r") do |io| while ! io.eof? print io.read(1) io.seek(1, IO::SEEK_END) # io.seek(1, IO::SEEK_CUR) # io.seek(1) io.seek(1, IO::SEEK_SET) # デフォルトなので上のなにもオプションがないのと同じ end end File.open("foo.txt", …