开发者

Erlang dets to txt

开发者 https://www.devze.com 2023-02-04 12:51 出处:网络
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 ad

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 or dets: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 a fun 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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号