massren
massren copied to clipboard
Dealing with already existing destination
Currently, massren doesn't deal with already existing files and throws up an error:
massren: "/path/to/file" cannot be renamed to "/some/file": destination already exists
There could be multiple strategies for dealing with such cases:
- Append some integer to the file. Most browsers do this with downloads.
- Overwrite the destination file.
- Skipping this file (& not renaming it) but continuing with others.
For me, option # 1 is the most used one, but # 3 sounds sane too.
Indeed that would be good to propose some alternatives. Overwriting would probably be what users would expect as this is how most posix tools work. However any overwrite or even renaming to something else shouldn't be automatic as that could cause a big mess if hundreds of files are involved.
Perhaps we should still display the current error message, but below ask the user what they want to do.
Perhaps we should still display the current error message, but below ask the user what they want to do.
If we have a long list of files to be processed, always asking the user on each file can be tedious so I propose options, based on @dufferzafar suggestions.
A new config option like existing_files
(or file_conflicts
or existing_destination
) with the options
append (or copy or duplicate)
overwrite
skip
ask
I agree that it should still show the error/warning message on each file, so we could output massren's output to file (will this work? massren -v >> ~/massren_log.txt
) to keep track of the files that weren't renamed, if the skip
option is set.
Hi. Is there any solution for this problem?