Skip to content

when use 7z, i found the error like this"Wrong update mode" #211

Answered by rikyoz
flutelifh1980 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi!
The error is due to the fact that the output archive file zipPath already exists on the filesystem.
By default, bit7z throws an error in such case.

If you want to update the existing archive, you need to set the correct UpdateMode:

compressor.setUpdateMode(UpdateMode::Append); // New items will be appended to the existing archive.
// or
compressor.setUpdateMode(UpdateMode::Update); // New items whose path already exists in the archive will overwrite the old ones, other will be appended.

If instead you want to entirely overwrite the existing archive file, you need to set OverwriteMode as follows:

compressor.setOverwriteMode(OverwriteMode::Overwrite);

In this case, the existing archive …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by flutelifh1980
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants