Skip to content

Windows does not identify folders correctly in zip #46

Open
@binary-koan

Description

@binary-koan

I'm trying to extract https://github.com/HaxeFoundation/haxe/releases/download/3.2.1/haxe-3.2.1-win.zip using decompress 4.0.0, but get a whole bunch of errors like

Error: EISDIR: illegal operation on a directory, open '...\haxe-3.2.1\std\flash\geom'
    at Error (native)
  errno: -4068,
  code: 'EISDIR',
  syscall: 'open',
  path: '...\haxe-3.2.1\std\flash\geom'

from file entries like

{ mode: 420,
  mtime: 2015-10-11T11:00:44.000Z,
  path: 'haxe-3.2.1/std/flash/geom/',
  type: 'file',
  data: <Buffer > }

It looks like the directories in that archive are marked as type: file (instead of directory), but oddly enough it only happens for that particular archive.

A quick fix I found was to treat files as directories if their path ends with a '/' (i.e. if (x.type === 'directory' || x.path.endsWith('/')) { /* mkdir -p */ }), but I don't know if that's a good idea or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions