DotNetZip.Semverd
DotNetZip.Semverd copied to clipboard
zip.ExtractAll() System.IO.IOException: 'Cannot create a file when that file already exists.
Trying to extract a node_modules zip, and hitting this exception early on. The extract is left with a .tmp file on one of the nested folders.
I cut down the node_modules.zip and copied one problem folder around and it seems the be the level of nesting of the folder that is causing the problem.
private void button1_Click(object sender, EventArgs e)
{
using (ZipFile zip = new ZipFile("C:\\DEV\\WindowsFormsApp1\\node_modules.zip"))
{
zip.ExtractAll("C:\\DEV\\WindowsFormsApp1\\");
}
}
Folder structure in the ZIP
dist
esm
estree-walker.js
node_modules
dist
esm
estree-walker.js
estree-walker
dist
esm
estree-walker.js
(the dist folder was replicated at different levels in the zip for testing, originally just under estree-walker folder)
The resuting output is
dist
esm
estree-walker.js
node_modules
dist
esm
estree-walker.js
estree-walker
dist
DotNetZip-ulvesib3.tmp
and the above exception.