sharpziplib - can you add a file without it copying the entire zip first?
- by schmoopy
Im trying to add an existing file to a .zip file using sharpziplib - problem is, the zip file is 1GB in size. When i try to add 1 small file (400k) sharpziplib creates a copy/temp of the orig zip file before adding the new file - this poses a problem when the amount of free disk space is less than 2x the zip file you are trying to update.
for example:
1GB zip myfile.zip
1GB zip myfile.zip.tmp.293
ZipFile zf = new ZipFile(path);
zf.BeginUpdate();
zf.Add(file); // Adding a 400k file here causes a 1GB temp file to be created
zf.EndUpdate();
zf.Close();
Is there a more efficient way to do this?
Thanks :-)