Elixir ファイル読み込み

File読込み。
[bash]
defmodule FileIO do
def main do
{:ok, file} = File.open("sample.txt", [:read, :utf8])
Enum.each(IO.stream(file, :line), fn(line) ->
IO.puts line
end )
File.close(file)
end
end
[/bash]

This entry was posted in Elixir, 技術情報. Bookmark the permalink.

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です