node-unzipper icon indicating copy to clipboard operation
node-unzipper copied to clipboard

can not unzip an empty folder

Open wseven7677 opened this issue 6 years ago • 8 comments

hi, i got a zip called 111.zip it was zipped from a folder called 111. i would unzip '111.zip'. I don't know there are things in the folder or not.

so when the folder called 111 has nothing in it, i got nothing after unzip 111.zip, which was supposed to be an empt folder called 111.

please help~

wseven7677 avatar Aug 20 '19 14:08 wseven7677

Can you please clarify: Does the zip file only contain an empty folder called 111? And you want the unzipper to just create this empty folder?

ZJONSSON avatar Aug 20 '19 17:08 ZJONSSON

Can you please clarify: Does the zip file only contain an empty folder called 111? And you want the unzipper to just create this empty folder?

@ZJONSSON

yes, the zip file only contain an empty folder called 111, and when i upzip it with unzipper, i got nothing, which i expect it to be an empty folder.

i use unzipper for lots of zip files called 111.zip, some of them contain a folder with files in it while others just contain an empty folder. maybe i can handle it as a special case, but i prefer to get just an empty folder.

wseven7677 avatar Aug 21 '19 02:08 wseven7677

Good point - the expected behavior should be to extract exactly what is in the zipfile, empty folders included.

ZJONSSON avatar Aug 21 '19 14:08 ZJONSSON

@ZJONSSON 🎉🎉🎉, so how long it will take to experience this feature?

i 'd like to update my schedule depending on the time when i can use this feature~

wseven7677 avatar Aug 22 '19 02:08 wseven7677

I just stumbled along this behavior too. I'd be very pleased if this would be added soon.

flokol120 avatar Sep 13 '19 10:09 flokol120

@ZJONSSON same issue here, when will you fix that ?

our users drop zip files with some empty folders, like pre formatted trees. Would be great to be able to detect / create empty folders when unziping.

Aarbel avatar Apr 15 '21 08:04 Aarbel

Hi, any solution? I need keep empty file

italogustavoborba avatar Jun 06 '23 02:06 italogustavoborba

I have the same requirement. May I ask if there has been any progress on this?

qq253498229 avatar Dec 21 '23 08:12 qq253498229

This has now been resolved by replacing fstream with fs-extra https://github.com/ZJONSSON/node-unzipper/pull/318/files#diff-ad67f830ededacce71edff0de408c01f6d287c3bb7c95f64cc5c3b0ae7494bdcR30

Empty directories are now explicitly extracted (see test)

Published as [email protected]

ZJONSSON avatar Jun 10 '24 12:06 ZJONSSON