Last active
August 29, 2015 13:56
-
-
Save sri-prasanna/8874407 to your computer and use it in GitHub Desktop.
ZipFile.Delete on a folder entry fails #48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
... | |
... | |
... | |
int FindExistingUpdate(ZipEntry entry) | |
{ | |
int result = -1; | |
string convertedName = GetTransformedFileName(entry.Name); | |
if (updateIndex_.ContainsKey(convertedName)) | |
{ | |
result = (int) updateIndex_[convertedName]; | |
} | |
else | |
{ | |
convertedName = GetTransformedDirectoryName(entry.Name); | |
if (updateIndex_.ContainsKey(convertedName)) | |
{ | |
result = (int)updateIndex_[convertedName]; | |
} | |
} | |
/* | |
// This is slow like the coming of the next ice age but takes less storage and may be useful | |
// for CF? | |
for (int index = 0; index < updates_.Count; ++index) | |
{ | |
ZipUpdate zu = ( ZipUpdate )updates_[index]; | |
if ( (zu.Entry.ZipFileIndex == entry.ZipFileIndex) && | |
(string.Compare(convertedName, zu.Entry.Name, true, CultureInfo.InvariantCulture) == 0) ) { | |
result = index; | |
break; | |
} | |
} | |
*/ | |
return result; | |
} | |
... | |
... | |
... | |
... | |
... | |
... | |
... | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment