Skip to content

Expose entry mtime in unzip API #268

Description

@tophf

What can't you do right now?
mtime of a zip entry is not exposed when unpacking.

An optimal solution

  • Add mtime property to the filter function in unzip options
  • Add mtime property to UnzipFile

Right now I'm patching the library in webpack build to expose time as a 32-bit number b4(data, o+12), converted later on demand (although the calc is trivial so you might just do it by default):

new Date(
  /*Y*/((time >> 25) & 0x7f) + 1980,
  /*M*/(time >> 21) & 0x0f - 1,
  /*D*/(time >> 16) & 0x1f,
  /*h*/(time >> 11) & 0x1f,
  /*m*/(time >> 5) & 0x3f,
  /*s*/(time & 0x1f) * 2);

(How) is this done by other libraries?
Previously I've used @zip.js which exposes it as lastModDate that is a JS Date.

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