Hello,
I am new to Elixir programming.
I’m attempting to retrieve zip files from one folder and extract their contents to another folder.
Although the code compiles without issues, I encounter the following error when executing it:
Failed to extract test1.zip because of {:EXIT, {{:badmatch, “test1.zip” …
Here is a part of the code :
for zip_file <- File.ls!(".") |> Enum.filter(&String.ends_with?(&1, ".zip")) do
case :zip.unzip(zip_file, [{:cwd, "."}]) do
{:ok, extracted_files} ->
# Filter for files with ".dcm" extension
dcm_files = Enum.filter(extracted_files, &String.ends_with?(&1, ".dcm"))
end
end
Thank you for your help