[erlang-questions] How to the a ets table is exists or not ?

Christian S chsu79@REDACTED
Sat Mar 15 12:36:05 CET 2008


2008/3/15 tatezhou@REDACTED <tatezhou@REDACTED>:
> I need to create a ets table if it is not exists, how to code it ?  I have
> check the online docs of chapter "ets", there is not function to handle this
>
> Current solution is to get all the ets tables and check if the table i want
> in the list. but i  don't think this is a good idea.
>
> Ret = ets:new(client_cmd_hooks, [named_table]),

Overall this seem a bit weird designed.

Who will be the designated ets table owner for this named table? First
arriving process to need the table to exist?

Why is it not created at start up by a supervised owner in your
application? If your application is running, the table is there, if
your application crashes, the owner will be restarted and create it
anew.



More information about the erlang-questions mailing list