kevva / kevva/decompress

Windows does not identify folders correctly in zip

Open
#46 7 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
419
Forks
55
PR merge metrics
No merged PRs in 30d

Description

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: }
```

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the extraction with the linked Haxe Windows ZIP and inspect how entries with paths ending in '/' are classified and written. Done means those entries are treated as directories and the archive extracts without EISDIR errors; no specific source file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.