Erlang Central

Save Data to a File

Revision as of 14:22, 24 September 2006 by Ayrnieu (Talk | contribs)


You want to save some data to a file.


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: