Skip to content

Instantly share code, notes, and snippets.

@olivermt olivermt/bug.ex
Created Mar 2, 2017

What would you like to do?
#This works in iex console:
#This does not work from a Task:
zip_files =, fn %{"id" => id, "name" => name} ->
Path.join(dest_dir, "#{id}-#{name}")
zip_target = Path.join(dest_dir, "") |> String.to_char_list
Logger.debug "Zipping files #{inspect zip_files} to #{inspect zip_target}"
zip_ret = :zip.create(zip_target, files)
Logger.debug "Zip return: #{inspect zip_ret}"
#This is the output
Zipping files ['c:/Users/oliver/AppData/Local/Temp/94ae7500-4850-49d9-a6b2-555ffd96c150/2-cutedog.jpg'] to 'c:/Users/oliver/AppData/Local/Temp/94ae7500-4850-49d9-a6b2-555ffd96c150/'
[debug] module=Sow.OSPApplicationExportService function=files/2 Zip return: {:error, :einval}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.