Domanda

got a problem with dets:to_ets/2

Could somebody point me to an example online? Ive looked at the man pages but I couldnt see any example usage. Couldn't find anything on google..

My problem seems to be with the actual dets:to_ets() function itself, not the creating of the dets. I have tested that on it's own and it's fine.

È stato utile?

Soluzione

You should create ETS table before use to_ets/2 function on it. The existing objects of the Ets table are kept unless overwritten. Do you have any {error, Reason} tuples in the result?

Altri suggerimenti

a quick example of dets:to_ets/2.

1> dets:open_file(d, [{file, "/tmp/d"}, {type, set}]).
{ok,d}
2> dets:insert(d, {a, 1}).
ok
3> dets:insert(d, {b, 2}).
ok
4> ets:new(e, [named_table, set]).
e
5> dets:to_ets(d, e).
e
6> ets:tab2list(e).
[{b,2},{a,1}]
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top