Archives can contain multiple files with the same name. By default, the duplicates are overwritten. The set_overwrite method changes this so that duplicates cause errors. It'd be useful if there was a way to modify the duplicate paths somehow so that archives with duplicate filenames can be extracted easily.
For example, when 7zip encounters duplicates, it gives you the option to auto-rename, which inserts a _n before the extension of each duplicate file. E.g., the second duplicate.txt would become duplicate_1.txt, then duplicate_2.txt, etc. Might be fun if you could pass a closure (e.g. Fn(&str, usize) -> &str) to determine your own rename policy.
Archives can contain multiple files with the same name. By default, the duplicates are overwritten. The
set_overwrite
method changes this so that duplicates cause errors. It'd be useful if there was a way to modify the duplicate paths somehow so that archives with duplicate filenames can be extracted easily.For example, when 7zip encounters duplicates, it gives you the option to
auto-rename
, which inserts a_n
before the extension of each duplicate file. E.g., the secondduplicate.txt
would becomeduplicate_1.txt
, thenduplicate_2.txt
, etc. Might be fun if you could pass a closure (e.g. Fn(&str, usize) -> &str) to determine your own rename policy.