ZipFile.jl icon indicating copy to clipboard operation
ZipFile.jl copied to clipboard

Add examples to the README

Open xiaodaigh opened this issue 6 years ago • 3 comments

I can't figure out how to use it.

xiaodaigh avatar Aug 29 '19 13:08 xiaodaigh

There's an example at ZipFile.jl (https://github.com/fhs/ZipFile.jl/blob/master/src/ZipFile.jl), but it's still frustrating that no documentation exists.

danilo-bc avatar Dec 13 '20 22:12 danilo-bc

You can also go through the testing source file to figure out how to use it as well. But there really should be clear examples in the Readme.md or anywhere else.

f0lie avatar Feb 09 '21 00:02 f0lie

Suggest using https://github.com/samoconnor/InfoZIP.jl instead but if you cannot for whatever reason here's an initial working example:

zarchive = ZipFile.Reader("target_file.zip")
extract_path = "some_location"
for f in zarchive.files
    if endswith(f.name, "/")
        # skip directories
        continue
    end

    extract_loc = joinpath(extract_path, f.name)
    open(extract_loc, "w") do fp
        write(fp, read(f))
    end
end

close(zarchive)

ConnectedSystems avatar Mar 08 '21 05:03 ConnectedSystems