Skip to content

file conflicts: add option to rename (add suffixes) #767

@marcospb19

Description

@marcospb19

Instead of asking overwrite? (y/n)

Ask overwrite? (y/n/rename)

Which accepts 'r' as the answer.

Later we can add a flag --rename (can bikeshed) to skip this question (same or different PR).

Proposed renaming behavior:

The file path/to/file.ext should be renamed to path/to/file-1.ext, but only for the file and folder paths that actually conflict (we can't detect conflicts in advance with how unpacking works right now to ensure it's applied to all files).

To clarify: if you add the suffix to folder-1, you don't need to add suffixes to files inside of that folder.

If file-1.ext already exists, bump the number and try that again, this might require multiple tries, try up to 99 and after just crash with a decent error message saying that we hit the limit and something strange is probably happening, people shouldn't rely on this behavior cause it's too wasteful and leaves tons of uncompressed archives taking space.

Prior discussion: #766.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions