title: How to read the contents of a file In Erlang?
body: <p>I know you can do something like this:</p>
  
  <pre><code>readlines(FileName) -&gt;
      {ok, Device} = file:open(FileName, [read]),
      get_all_lines(Device, []).
  
  get_all_lines(Device, Accum) -&gt;
      case io:get_line(Device, "") of
          eof  -&gt; file:close(Device), Accum;
          Line -&gt; get_all_lines(Device, Accum ++ [Line])
      end.
  </code></pre>
  
  <p>Is there a one liner BIF that can do this too?</p>