Skip to content

zip2 generates zip with leading slashes in file names #102

@k-bx

Description

@k-bx

I'm generating some kmz files with zip2. After some updates, it seems to be producing zip files with leading slashes in names:

$ unzip -l file.kmz
Archive:  file.kmz
  Length      Date    Time    Name
---------  ---------- -----   ----
     3116  05-06-2024 15:27   /point-green.png
      943  05-06-2024 15:27   /doc.kml
---------                     -------
     4059                     2 files

This is opposed to the same zip created via standard macOS utilities:

$ unzip -l file2.kmz
Archive:  file2.kmz
  Length      Date    Time    Name
---------  ---------- -----   ----
      943  05-06-2024 15:14   doc.kml
      176  05-06-2024 15:14   __MACOSX/._doc.kml
     3116  05-06-2024 15:14   point-green.png
      176  05-06-2024 15:14   __MACOSX/._point-green.png
---------                     -------
     4411                     4 files

The leading slashes break Google Earth from opening the zip file, and also seems to be some info claiming they are not correct according to the standard.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions