Currently, there's a loop to append suffixes (_1, _2, _3, ...) when trashinfo already exists, which is good.
However, given a trashinfo, our target path_of_backup_copy might already exists, which will cause the algorithm to fail.
E.g.:
$ ls ~/.local/share/Trash/info
my_dir_1.trashinfo
$ ls ~/.local/share/Trash/files
my_dir_1/
my_dir_2/
my_dir_3/
The looping will confirm to use my_dir_2.trashinfo as the target trashinfo, and only realises that the my_dir_2 = path_of_backup_copy("my_dir_2.trashinfo") actually already exists when performing the move via OS call:
trash: Failed to trash build/ in ~/.local/share/Trash, because: Destination path '/home/xxx/.local/share/Trash/files/my_dir_2' already exists
The existence of my_dir_2/, my_dir_3/, ... might be due to other similar named files, trashed by the system file manager, etc.
Currently, there's a loop to append suffixes (_1, _2, _3, ...) when trashinfo already exists, which is good.
However, given a trashinfo, our target
path_of_backup_copy
might already exists, which will cause the algorithm to fail.E.g.:
The looping will confirm to use
my_dir_2.trashinfo
as the target trashinfo, and only realises that themy_dir_2 = path_of_backup_copy("my_dir_2.trashinfo")
actually already exists when performing the move via OS call:The existence of
my_dir_2/
,my_dir_3/
, ... might be due to other similar named files, trashed by the system file manager, etc.