detect moved dirs in sync dirs tool

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
d
Member
Member
Posts: 157
Joined: 2007-02-05, 14:54 UTC

detect moved dirs in sync dirs tool

Post by *d »

this idea must be already suggested many times in this forum. i have seen today several of them:

viewtopic.php?f=3&t=7927 : Jun 30, 2005 : RFNagel :
In other words, there isn't an easy way in Total Commander to incrementally copy the main hard drive to the backup hard drive in verbatim... including empty directories, and/or directories that have been renamed or moved, as well as files that have an older file date on my main drive (which are the ones that I wish to back up) compared to the existing files that were previously backed up on my backup hard drive. ... (incrementally, *only* copying and/or deleting the necessary files on the backup drive)
viewtopic.php?f=3&t=18495 : Mar 04, 2008 : babrams :
... EXAMPLE: On my original drive, I am moving the files to different directories I created. Then, I want to sync those changes.

TC doesn't just move the files on the drive I am syncing to. TC deletes the files, then copies them to the new directories on the sync drive. But when TC deletes the files, they hold space in the recycle bin.
Mar 23, 2020 : milink :
Maybe there could be a checkbox to "Detect moved files" for it...
viewtopic.php?f=14&t=48210 : May 29, 2021 : d :
i made backup of documents to a my client, with simple file copying. then, they need to make many movements, file renamings. then in the next backing up, tc's synchronise dirs is going to show all the moved/renamed files and directories as different. that is a big problem on syncing/backing up. if git was connected to that entire place (in this case, it is local disk d with documents, pictures etc moved here from c), and all renamings and movements were made with git, then probably that can be efficiently synced with backup disk. but, to say the truth, the client used to use windows explorer, so if even windows explorer was integrated to git, it would be ok.
d
Member
Member
Posts: 157
Joined: 2007-02-05, 14:54 UTC

Re: detect moved dirs in sync dirs tool

Post by *d »

i submitted this now, on this state of the text, by mistake, probably pressed submit instead of preview. but it is also ok, and i continue here (with a separate post).

i have not tried latest versions of tc, but from the some fresh replies i see that this is still not implemented.

total commander also has duplicate search function in the file search tool.

in the sync tool, total commander could also find and display duplicate files and also duplicate directories. what is a duplicate directory? i suggest taking in account only file index of directories. thus, directories are nodes, and nodes differ by having same list different lists of files, that are directly in them.

this could be also in the search tool. if user has duplicate of a dir with 100 files, it will be shown 100 times in search tool. if tc takes in account dirs, it could show them only once. also, there can be different levels of duplicates: partial duplicates, full duplicates. if all files are same, they are full duplicates, if several files differ, several are same - partial duplicates.

if tc shows some indicators in sync tool saying "duplicate of this folder is found", user could open context menu and do something with them.
Last edited by d on 2021-05-31, 15:20 UTC, edited 1 time in total.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: detect moved dirs in sync dirs tool

Post by *ghisler(Author) »

I would have added this long ago if it were easy. The problem is that you rarely just have a renamed folder - instead, there are often added/removed files in these folders, and even files from multiple folders combined into one.
Author of Total Commander
https://www.ghisler.com
d
Member
Member
Posts: 157
Joined: 2007-02-05, 14:54 UTC

Re: detect moved dirs in sync dirs tool

Post by *d »

ghisler(Author) wrote: 2021-05-31, 13:41 UTC I would have added this long ago if it were easy. The problem is that you rarely just have a renamed folder - instead, there are often added/removed files in these folders, and even files from multiple folders combined into one.
you could start with simplest case - "full" duplicates. probably there are also other problems, actual even for full duplcates.

full duplicates also can have different meaning, as in search tool, duplicates can be found by name, time, size, maybe also content (i do not know, i am sitting on linux now).
d wrote: 2021-05-31, 13:32 UTC if tc shows some indicators in sync tool saying "duplicate of this folder is found", user could open context menu and do something with them.
duplicate on opposite site maybe better named as not duplicate but something else.

what actions can be in context menu?

scroll to the duplicate

left and right panes can be made scrollable independently as in file comparison, then:
scroll this side to opposite dir
scroll opposite side to this dir

rename/move this side as on the opposite side
rename/move the opposite side as on this side
rename both sides at once, full paths also could be renamed at once.
in case these two dirs differ by subdirs tc could move subdirs together, for now, user can manage them manually later.

directory trees, without file branches, also can be huge. they can be visualised as trees with root on top (root on top is a usual orientation in many sciences). file list contents maybe regarded as nodes and shown with different color (red) if they differ, but dir names are same. trees of left and right side can be put one onto another with a small shift to make differing places visible.

renaming/moving as on opposite side can be also applied to similar files, which are in same dirs, in opposite sides.
how they can be detected?
in case comparison by content is made, they can be found using md5 or other hashes.
if not, then they can be found by almost equal size, if all files in the dir have different sizes...
and/or almost similar names, measured with something like levenshtein distance.

what if renaming/moving as on the opposite is not possible because there is already dir/file with same target name?
tc could offer to rename the already existing dir/file.
tc could offer to scroll to it, then user can check, whether it is similar with its opposite.
tc could automatically report whether the already existing file/dir is similar with opposite or not, and whether it has differing subdirs.
d
Member
Member
Posts: 157
Joined: 2007-02-05, 14:54 UTC

Re: detect moved dirs in sync dirs tool

Post by *d »

drawing directory trees look hard also it is going to be hard to read, because directory names put near nodes will be a mess. there is a simpler method. just to hide all files in the sync tool, and show differing dirs with color. (maybe hiding all files or direct childs of every dir separately is already implemented. i do not know, i am sitting on linux.)
Post Reply