Thanks to visit codestin.com
Credit goes to github.com

Skip to content

zip_append does not replace when file already in archive #111

@8qube

Description

@8qube

Appending a file to a zip archive does not overwrite the old file if exists but adds a new file.
This results in archives with replicate file names :

> cat("lala",file="lala.txt")
> cat("lblb",file="lblb.txt")
> zip::zip("lala.zip","lala.txt")
> zip::zip_list("lala.zip")
  filename compressed_size uncompressed_size           timestamp permissions    crc32 offset
1 lala.txt               9                 4 2024-04-25 08:53:34         600 ea5c43d5      0
> zip::zip_append("lala.zip","lblb.txt")
> zip::zip_list("lala.zip")
  filename compressed_size uncompressed_size           timestamp permissions    crc32 offset
1 lala.txt               9                 4 2024-04-25 08:53:34         600 ea5c43d5      0
2 lblb.txt               9                 4 2024-04-25 09:30:38         600 d87f7e0c     63
> zip::zip_append("lala.zip","lblb.txt")
> zip::zip_list("lala.zip")
  filename compressed_size uncompressed_size           timestamp permissions    crc32 offset
1 lala.txt               9                 4 2024-04-25 08:53:34         600 ea5c43d5      0
2 lblb.txt               9                 4 2024-04-25 09:30:38         600 d87f7e0c     63
3 lblb.txt               9                 4 2024-04-25 09:30:38         600 d87f7e0c    126

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions