Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"The same volume can not be used as both source and destination" when extracting the zip file using winzip #436

Closed
najes opened this issue Oct 31, 2019 · 6 comments
Labels
fixed Issue or bug has been fixed

Comments

@najes
Copy link

najes commented Oct 31, 2019

The zip file created by minizip 2.9.0 cannot be extracted on the same volume?
I keep getting warning below if i tried to extract zip file using winzip on windows file explorer (it works on 7zip though) :

image

Did i miss something on the zip options part?

options.compress_methodMZ_COMPRESS_METHOD_STORE
options.compress_levelMZ_COMPRESS_LEVEL_DEFAULT
options.append1
options.overwrite1
options.follow_links0
options.store_links0
options.include_path0
options.zip_cd0
options.aes0
options.encodingMZ_ENCODING_UTF8
options.disk_size512*1024
options.cert_pathNULL
options.cert_pwdNULL
Thanks!

@nmoinvaz
Copy link
Member

Please attach a zip file that reproduces the problem.

@najes
Copy link
Author

najes commented Nov 1, 2019

Here is one of the zip file

@nmoinvaz
Copy link
Member

nmoinvaz commented Nov 1, 2019

It looks like you are appending entries to the zip file. Can you please share the command lines that you used to create this archive?

@najes
Copy link
Author

najes commented Nov 1, 2019

int32_t err = 0;
char* szFile[ ] = { "TEST.EXE", "TEST.INI", .... }
for(int i=0, i<(sizeof(szFile)/sizeof(szFile[0])), i++)
{
  err = (minizip_add(path, password, &options, 1, &szFile[i]));
  if(err == !=MZ_OK)
  {
    .....
  }
}

@nmoinvaz
Copy link
Member

The minizip_add function is not intended to be used in this manner. You should be using the logic inside minizip_add and calling mz_zip_writer_add_path for each entry you want to add, otherwise you are opening the zip file over and over to add each file.

@nmoinvaz
Copy link
Member

nmoinvaz commented Nov 11, 2019

It is likely that Windows Explorer does not support split disks. If compatibility with Windows Explorer zip tool is important to you, then specify 0 for disk_size.
https://stackoverflow.com/questions/31286707/the-same-volume-can-not-be-used-as-both-the-source-and-destination

@nmoinvaz nmoinvaz added 2.0 fixed Issue or bug has been fixed labels Jan 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed Issue or bug has been fixed
Projects
None yet
Development

No branches or pull requests

2 participants