8000 Adding a file currently being written · Issue #332 · zlib-ng/minizip-ng · GitHub
[go: up one dir, main page]

Skip to content

Adding a file currently being written #332

Closed

Description

@chrfle

Hello

Is there any specific reason minizip does not allow adding files that are open in write mode?

I tracked it down to this line:
https://github.com/nmoinvaz/minizip/blob/master/mz_strm_os_win32.c#L75

Where it's explicitly stated that only files that are open read only are allowed to be added.

Changing it to FILE_SHARE_READ | FILE_SHARE_WRITE seems to solve it for my application. Would you mind such a change upstream?

Activity

  1. nmoinvaz commented on Oct 31, 2018

    @nmoinvaz
    Member

    Can you explain to me the use case a bit more. In what use case would it be okay to simultaneously write to the zip file as another process? Is it another zip file program has opened the zip?

  2. chrfle commented on Oct 31, 2018

    @chrfle
    ContributorAuthor

    In our case it's two different threads in the same process.

    We record one or more streams of data. When the user decides to save the project we create an info file with some metadata and zip that together with the data streams into a single project file. We would like to be able to do this while data is still being recorded.

    This used to work in the 1.1 version of minizip. And it works on Linux in 2.5.3 that we are currently using. I assume it works on mac too, but haven't tested. But not on Windows due to the READ share mode.

  3. nmoinvaz commented on Oct 31, 2018

    @nmoinvaz
    Member

    I have made the commit in the dev branch. Thanks.

  4. chrfle commented on Nov 1, 2018

    @chrfle
    ContributorAuthor

    Great, any estimate for when it will hit a "stable" (read tagged) release? Our software security department are iffy about using dev branches ^_^

  5. nmoinvaz commented on Nov 1, 2018

    @nmoinvaz
    Member

    Probably sometime later this week.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixedIssue or bug has been fixed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0