Replies: 1 comment
-
Unfortunately there isn't a direct way to do this, and I think there should be, so I'll definitely be working on adding that option as soon as possible.
For now, the only way to remove a folder and its contents is something similar to this: std::vector<uint32_t> indexes;
{
BitArchiveReader reader{lib, "./multiple_items.zip", BitFormat::Zip};
for (const auto& item : reader) {
if (item.path().starts_with("folder")) {
indexes.push_back(item.index());
}
}
}
BitArchiveEditor editor{lib, "./multiple_items.zip", BitFormat::Zip};
for (uint32_t index : indexes) {
editor.deleteItem(index);
}
editor.applyChanges(); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How can I recursively remove a directory and all of it's contents in an existing archive?
I imagine using the BitArchiveEditor class, but I'm not sure how to use it to recursively remove a directory and it's contents.
Beta Was this translation helpful? Give feedback.
All reactions