Reputation: 7517
As in the title or how to write to a new line in Erlang?
Thank You!
Upvotes: 1
Views: 1535
Reputation: 170745
Use the io:fwrite
functions. See this article and this tutorial for examples.
Here is a short snippet to showcase,
39> {ok, FD} = file:open("test.txt",[read, write]).
{ok,<0.130.0>}
40> io:fwrite(FD, "First line ~n", []).
ok
41> io:fwrite(FD, "Second line ~n", []).
ok
Upvotes: 6