question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Windows does not identify folders correctly in zip

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

11reactions
dabutvincommented, Oct 9, 2018

FWIW I had success working around this using a filter

decompress(source, destination, {
  filter: file => !file.path.endsWith('/')
})
1reaction
ahkohdcommented, Aug 26, 2019

FWIW I had success working around this using a filter

decompress(source, destination, {
  filter: file => !file.path.endsWith('/')
})

Worked like a charm, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

When I right click the blank in a folder, I can't find the choice
Hello, When I right click the blank in a folder, it is: There is no choice of "New compressed folder". What's the reason?...
Read more >
Fix Exracted Files or Files Not Showing in Folder Windows 10
Here are four solutions for files not showing in folder or extracted files not showing up in Windows 10. Try it to retrieve...
Read more >
Fix "Unable to Open ZIP Files in Windows 10" (One ... - YouTube
Can 't open zip files in Windows 10? You can fix the problem quite easily by following this simple method. Please let's know...
Read more >
How to fix a directory that is there but doesn't exist? - Super User
Be sure to open the Zip file in Windows Explorer when you are extracting the contents so that Windows Explorer names the files...
Read more >
Zip file is unreadable; cannot open zip file - NWEA Connection
Navigate to the folder location where the zip file was saved. · Right-click on the zip file and choose Open with... · Select...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found