massren icon indicating copy to clipboard operation
massren copied to clipboard

Dealing with already existing destination

Open dufferzafar opened this issue 7 years ago • 3 comments

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:

  1. Append some integer to the file. Most browsers do this with downloads.
  2. Overwrite the destination file.
  3. Skipping this file (& not renaming it) but continuing with others.

For me, option # 1 is the most used one, but # 3 sounds sane too.

dufferzafar avatar Sep 06 '16 11:09 dufferzafar

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.

laurent22 avatar Sep 06 '16 20:09 laurent22

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.

ghost avatar Mar 20 '18 16:03 ghost

Hi. Is there any solution for this problem?

06opoTeHb avatar May 24 '21 04:05 06opoTeHb