':dets.open_file argument error

iex(1)> :dets.open_file(:storage, [{:type, :set}])           
{:ok, :storage}

When I try to use other argument, which should be perfectly fine regarding Erlang documentation:

iex(2)> :dets.open_file(:storage, [{:type, :set}, {:file, "file"}])
** (ArgumentError) argument error

UPD:

iex(4)> :dets.open_file(:storage, [{:type, :set}, {:file, 'file'}])
{:error, :incompatible_arguments}


Solution 1:[1]

Try this

:dets.open_file('file', [{:type, :set}])

Solution 2:[2]

:dets.open_file(:storage, [{:type, :set}, {:file, String.to_atom("file")}])

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 big-town
Solution 2 Syscall