Skip to content

Instantly share code, notes, and snippets.

@stwind
Created August 25, 2011 08:59
Show Gist options
  • Save stwind/1170278 to your computer and use it in GitHub Desktop.
Save stwind/1170278 to your computer and use it in GitHub Desktop.
Write string content to file
Write = fun(Content) ->
{ok, F1} = file:open("content.txt", [write]),
file:pwrite(F1, 0, unicode:characters_to_binary(Content)),
file:close(F1)
end.
Write("Hello Erlang").
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment