bower / decompress-zip

Module that decompresses zip files
MIT License
102 stars 76 forks source link

Race condition on windows where zip contains uppercase and lowercase directory names #44

Open Deothrin opened 9 years ago

Deothrin commented 9 years ago

Zip files containing directories with identical names but different capitalization will not unzip correctly on windows os. For example

project/Test project/test

will be unzipped by 7-zip into the same folder on windows. Decompress-zip will store them as two separate paths in the cache and then test both for existance before creating either of them. Neither test will return true and decompress will try and create both, succeeding on the first then mkdir will fail on the second because it already exists. This could be fixed by lowercasing the cached dir name on window systems. Of course having identically named directories (except for the case) unpacked into the same directory has its own problems, but this is how 7-zip appears to work and is probably better than throwing an exception.