Erlang dets to txt
How can i wri开发者_StackOverflow中文版te information which store in dets to txt file?
Thank you.
Since you've provided little to no information on what you mean or what you intend to do, the only advice I can give you is to read the dets manual. The functions you'll likely need are:
dets:open_file/1
ordets:open_file/2
to open the file that has the information in it.dets:traverse/2
to walk over the data in your store passing in afun
that does whatever you want (in this case writing to a text file).dets:close/1
to close the data store.
If you want more specific advice or if you're thinking of something entirely different you'll have to ask a better question—one that has details, for example.
An example of the answer by "JUST MY correct OPINION" is in "Mnesia User's Guide".
{ok, N} = dets:open_file(schema, [{file, "./schema.DAT"},{repair,false},
{keypos, 2}]),
F = fun(X) -> io:format("~p~n", [X]), continue end,
dets:traverse(N, F),
dets:close(N).
http://www.erlang.org/doc/apps/mnesia/Mnesia_chap7.html#id75830
精彩评论