Thanks immensely @voughtdq for this clear explanation.
I have tried it as mentioned but i got bad match error
case :zip.unzip(~c'priv/static/files/document.zip', [{:cwd, ~c'/tmp/test-extracted/'}]) do
{:ok, content} ->
IO.inspect content
{:error, error} ->
IO.inspect(error)
end
The logged output is
{:EXIT,
{:function_clause,
[
{:zip, :get_unzip_opt,
[
{:cwd, '/tmp/test-extracted/'},
{:unzip_opts, #Function<21.81481102/2 in :zip.get_unzip_options/2>,
#Function<26.81481102/2 in :zip.get_input/1>,
#Function<22.81481102/1 in :zip.get_unzip_options/2>, [:raw],
#Function<23.81481102/1 in :zip.get_unzip_options/2>, []}
], [file: 'zip.erl', line: 538]},
{:zip, :do_unzip, 2, [file: 'zip.erl', line: 364]},
{:zip, :unzip, 2, [file: 'zip.erl', line: 358]},
{RecordBank.Modules.Import, :unzip, 0,
[file: 'lib/record_bank/modules/import.ex', line: 5]},
{:erl_eval, :do_apply, 6, [file: 'erl_eval.erl', line: 670]},
{:elixir, :eval_forms, 4, [file: 'src/elixir.erl', line: 233]},
{IEx.Evaluator, :handle_eval, 5, [file: 'lib/iex/evaluator.ex', line: 250]},
{IEx.Evaluator, :do_eval, 3, [file: 'lib/iex/evaluator.ex', line: 230]},
{IEx.Evaluator, :eval, 3, [file: 'lib/iex/evaluator.ex', line: 208]},
{IEx.Evaluator, :loop, 1, [file: 'lib/iex/evaluator.ex', line: 94]},
{IEx.Evaluator, :init, 4, [file: 'lib/iex/evaluator.ex', line: 24]},
{:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}
]}}
Please what could be wrong?