Thanks for a great lib.
I'm using it to backup and restore a folder structure used by a program of mine. Now, I've come across a problem in the extract process where I'm having a ZipException and an inner exception of IOException. I should mention also that this problem only happens
when I'm overwriting existing files.
Here's the IOException:
Ionic.Zip.ZipException: Cannot extract ---> System.IO.IOException: The process cannot access the file 'C:\Temp\...\SomeFolder' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.OpenHandle(String path)
at System.IO.Directory.SetCreationTimeUtc(String path, DateTime creationTimeUtc)
at Ionic.Zip.ZipEntry._SetTimes(String fileOrDirectory, Boolean isFile)
at Ionic.Zip.ZipEntry.InternalExtract(String baseDir, Stream outstream, String password)
The reason this fails is because I accidently had Explorer looking at the very same folder being extracted. I can understand this because Win explorer locks the folder it is viewing. So, I tried setting ZipFile.ExtractExistingFile = DoNotOverwrite thinking
this would help, but it didn't.
Looking at the source code I can see that you're handling the _SetTimes(...) differently depending on whether its being called from InternalExtract() or from ValidateOutput(). In ValidateOutput() you would only call _SetTimes() for an existing folder if
ExtractExistingFile equals OverwriteSilently.
What I would like is to be able to overwrite any existing file but to leave existing folders untouched (due to the lock problem with Win Explorer). Is this possible?