문제

How can i write 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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top