Skip to content

Commit

Permalink
Close file after unzip operation
Browse files Browse the repository at this point in the history
  • Loading branch information
davidanthoff committed Feb 17, 2017
1 parent 2615271 commit e722f0e
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 e722f0e

Please sign in to comment.