Elixir :dets.open\u文件参数错误
当我尝试使用其他参数时,这对于Erlang文档应该是非常好的:Elixir :dets.open\u文件参数错误,elixir,Elixir,当我尝试使用其他参数时,这对于Erlang文档应该是非常好的: iex(1)> :dets.open_file(:storage, [{:type, :set}]) {:ok, :storage} UPD: 试试这个 iex(4)> :dets.open_file(:storage, [{:type, :set}, {:file, 'file'}]) {:error, :incompatible_arguments} 请尝试使用单引号作为文件名。大多数Erl
iex(1)> :dets.open_file(:storage, [{:type, :set}])
{:ok, :storage}
UPD:
试试这个
iex(4)> :dets.open_file(:storage, [{:type, :set}, {:file, 'file'}])
{:error, :incompatible_arguments}
请尝试使用单引号作为文件名。大多数Erlang API都希望文件路径有一个字符表。@Dogbert,仍然有错误,但似乎很接近。您能在新的
iex
会话中尝试吗?错误似乎是由于您之前创建了同名但没有文件的DETS造成的。@Dogbert,是的,您是对的
iex(4)> :dets.open_file(:storage, [{:type, :set}, {:file, 'file'}])
{:error, :incompatible_arguments}
:dets.open_file('file', [{:type, :set}])