如果它不存在,我想在 ets 中创建一个表。如何检查此命名是否存在?
最佳答案
您可以使用 :ets.whereis/1
.它将返回 :undefined
如果命名表不存在:
iex(1)> :ets.new :foo, [:named_table]
:foo
iex(2)> :ets.whereis :foo
#Reference<0.2091350666.119668737.256142>
iex(3)> :ets.whereis :bar
:undefined
关于erlang - 如何检查 ETS Erlang/Elixir 中是否存在命名表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52094933/