Save Data to a File
From Erlang Community
[edit] Problem
You want to save some data to a file.
[edit] Solution
Where 'some data' is simply a list, you have this simple solution:
file:write_file(Path, Data). |
But if you want to save an Erlang data structure, to perhaps file:consult/1 later, you have this slightly more complex solution:
file:write_file(Path,io_lib:fwrite("~p.\n",[Data])).
|

Digg It
Del.icio.us
Reddit
Facebook
Stumble Upon
Technorati
Click here to order from amazon.com