Skip to content

ZipFile.Delete on a folder entry fails #48

Closed

Description

@dgrunwald

SD-1915, originally created on 10/10/2012 01:39:29 by David Pierson

ZipFile.Delete on a folder entry fails with an exception.

The call to FindExistingUpdate changes the name of what is being looked
for and it fails to find the key.

community.sharpdevelop.net/forums/t/16314.aspx

Activity

  1. sri-prasanna commented on Feb 8, 2014

    @sri-prasanna

    Hi @dgrunwald, I took a look at the code. It first looked like a minor fix to the ZipFile.cs file. Whereby, in the function FindExistingUpdate(ZipEntry entry) in addition to checking if the transformed-file-name is present in updateIndex_, we could just also check present of transformed-folder-name. Please refer to https://gist.github.com/sri-prasanna/8874407 to see what I mean. After adding this, the folder is correctly identified to be present in the updateIndex_. But, the program still fails at a later stage.
    In the CopyEntryDirect method, the nameLength and extraLength variables are populated. For a test zip file (which contained one empty folder and one text file), these two variables come to have a very large number. Much larger than the actual size of the file. Resulting in sourcePosition being a very large value. So, the program fails at CopyEntryDataDirect method. This is strange. Are you able to shed some light on where I could look at, to progress w/ my analysis? Thanks.

  2. sri-prasanna commented on Feb 8, 2014

    @sri-prasanna

    Hi. I ran tests with some more zip files (All tests on Windows 7). For some zip files, the nameLength and extraLength variables have expected values. And for some zip files, these two values are really large and cause failure at CopyEntryDataDirect method..

    Let me know if you have some suggestions..

  3. self-assigned this
    on Apr 15, 2016
  4. Numpsy commented on Oct 11, 2020

    @Numpsy
    Contributor

    Is the deleting of folder entries all fixed now?

  5. piksel commented on Oct 13, 2020

    @piksel
    Member

    It should be. Otherwise a new ticket should be created anyway since the mentioned root cause here should at least not trigger it anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions