stash icon indicating copy to clipboard operation
stash copied to clipboard

Fix persist/2 and load/2

Open mnishiguchi opened this issue 3 years ago • 0 comments

This is to fix https://github.com/whitfin/stash/issues/1. Currently persist/2 and load/2 seem broken due to wrong data type for path.

Currently path is passed as a String; however, the Erlang functions do not see to accept a String.

iex> :dets.open_file(:my_dets_table, file: 'hello')
{:ok, :my_dets_table}

iex> :dets.open_file(:my_dets_table, file: "world")
** (ArgumentError) argument error
    (stdlib 3.15.1) dets.erl:658: :dets.open_file(:my_dets_table, [file: "world"])

As soon as the data type is corrected, it gets working as expected.

mnishiguchi avatar Jun 27 '21 23:06 mnishiguchi