Skip to content

Commit

Permalink
Merge pull request #6 from davidanthoff/fix-unzip-error
Browse files Browse the repository at this point in the history
Close file after unzip operation
  • Loading branch information
samoconnor authored Mar 28, 2017
2 parents 2615271 + e722f0e commit f9afdac
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/zip_file.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,11 @@ end
# Based on fhs/ZipFile.jl#16, thanks @timholy.

function unzip(archive, outputpath::AbstractString=pwd())
for (filename, data) in open_zip(archive)
filename = joinpath(outputpath, filename)
mkpath_write(filename, data)
open_zip(archive) do file
for (filename, data) in file
filename = joinpath(outputpath, filename)
mkpath_write(filename, data)
end
end
end

Expand Down

0 comments on commit f9afdac

Please sign in to comment.