[WDX] SkipCompare: Skip compare contents in Sync

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: sheep, Hacker, Stefan2, white

Post Reply
User avatar
MVV
Power Member
Power Member
Posts: 8160
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

[WDX] SkipCompare: Skip compare contents in Sync

Post by *MVV » 2013-02-23, 12:27 UTC

SkipCompare plugin allows skip of compare contents for predefined file categories in Sync tool. Initially it has been written in 2011 for some users from Russian board.

Last version information

Version no: 1.0.0.28 32/64
URL: SkipCompare at wincmd.ru / SkipCompare at totalcmd.net

Requirements: operating system Windows 2000 and above, Total Commander :)

Features:

+ skips compare contents for predefined file masks or search templates
+ allows chosing equal sign to mark affected files

General information:

Last TC versions allow to choose compare modules and functions for predefined file categories. 'User-defined compare functions' dialog may be accessed from Sync dialog, you need to enable compare by contents and click small ">>" button near that option.

In 'User-defined compare functions' dialog you need to enable custom compare functions add file mask or search template (last ones allow to limit file size, play with file attributes etc.). Then you can choose compare module and function. SkipCompare module functions allow skip compare and to mark files as equal (with SKIP word instead of equality sign), unequal or as uncompared depending on chosen function.

AntonDudarenko
Member
Member
Posts: 106
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Post by *AntonDudarenko » 2013-03-22, 07:39 UTC

if to be honest - I couldn't understand how to use this plugin.
Maybe some video? pictures? step-by-step guide could help to us?
#146217 personal license

User avatar
MVV
Power Member
Power Member
Posts: 8160
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2013-03-22, 10:51 UTC

AntonDudarenko,
E.g. how to skip compare for ISO files larger than 100 MB:
1. Install plugin:)
2. Open Sync tool.
3. Mark 'by content' option and click '>>' button right to it.
4. Enable option 'Use plugin compare functions'.
5. Click 'Add...'.
6. You can specify filemask just here but we need more rules so click 'Define...'.
7. Type '*.iso' in 'Search for' box.
8. Switch to 'Advanced' tab and set file size rule to > 100 MB.
9. Click 'Save' button, enter template name 'ISO > 100 MB' and click 'OK'.
10. Select saved template in previous dialog's list (it should be already selected) and click 'OK'.
11. In dialog 'Custom fields by file type' you need to add comparer. Click '+' button and select one from 'skipcompare' submenu.
12. Close two dialogs by clicking 'OK'.

Now TC will not compare contents of ISO files larger than 100 MB and will immediately mark them as uncompared, different or using special equal sign depending on chosen comparer at step 11.

Note that after next opening sync tool you may need to repeat steps 3 and 4. And, to disable plugin just uncheck option from step 4.

AntonDudarenko
Member
Member
Posts: 106
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Post by *AntonDudarenko » 2013-03-22, 11:28 UTC

not so quickly))
ups, okey - some part from whole answer I found at your post....

but not all:
http://s2.ipicture.ru/uploads/20130322/Vb87xM0p.jpg
so - you're saying that we can use all these fields?
and we should not put any additional data right after the name of selected field?

for ex. I want to ignore 2 specific subfolders during comparing 2 dirs.
Is is possible to do so with your plugin?
Couldn't you please add a screenshots - how it should looks like.
On all major steps.

P.S. in another words - you want to say that these 3 fields are in fact low-level commands to TС - what it should do with files which are covering by created template during execution of some operation? like compare 2 dirs for ex?

But in this case I understand what the first field can do. But how next 2 fields will work?
#146217 personal license

User avatar
MVV
Power Member
Power Member
Posts: 8160
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2013-03-22, 12:01 UTC

All three functions work in similar way: when TC asks them to compare files, they do nothing but return some result.

If you need to skip specific subdirs, you should use filter between left and right folder fields in Sync dialog. Or you may select files/folders to compare before starting Sync tool to compare only them.

AntonDudarenko
Member
Member
Posts: 106
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Post by *AntonDudarenko » 2013-03-22, 12:06 UTC

I have 2 general dir structures with more that 30 subfolders at each.
And only 2 subfolders from them I should ignore. Obviously that when I have to compare the content of these 2 general dirs
I will open inside TC's panels only these 2 general dirs - on left panel and on right panel and will start Compare Dirs operation.
And also I hoped that your plugin can help me to skip comparing of some subfolder and it's all content of course! during this operation.
But looks like you want to say that this is impossible
#146217 personal license

User avatar
MVV
Power Member
Power Member
Posts: 8160
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2013-03-22, 13:08 UTC

You can't do such task with this plugin. It allows to skip compare contents only for files that may be detected by search template.
Last edited by MVV on 2013-03-22, 13:29 UTC, edited 2 times in total.

AntonDudarenko
Member
Member
Posts: 106
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Post by *AntonDudarenko » 2013-03-22, 13:22 UTC

hmmmm. but any file which "may be detected by search template." - obviously has a full? absolute path ;) - which we can parse with RegExp.
So IF user said that he doesn't want to compare folder (and it's childs) which name possibly contains *rare_file* - so be it.

Maybe you can extend the functionality of your plugin in such manner?
#146217 personal license

User avatar
MVV
Power Member
Power Member
Posts: 8160
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2013-03-22, 13:30 UTC

My plugin doesn't work with templates directly, it only processes files that are already filtered by TC. You can use 'Plugins' tab in search template to check if file path contains some string.

Also, if you need to skip two subdirs that are directly in compared dirs, you can use filter as I told before (just type in filter field |dir1name\ dir2name\). Inner dirs you can temporary hide by using TC ignore list.

AntonDudarenko
Member
Member
Posts: 106
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Post by *AntonDudarenko » 2013-03-25, 07:33 UTC

Hmm - I don't understand - IF you said "My plugin doesn't work with templates directly, it only processes files that are already filtered by TC" - that should mean that inside the plugins' code you can add the possibility to use extended variant of filtering. Like as i said - for the file which absolute path contains some "REGEXP" - do not allow its next using at TC's compare dirs operation.
And it would be much more easy to use such filter exactly at your plugin - "at one place" - as we are saying. Because current situation (in search template put one info, in plugin itself - put another - in filter field - put something else) - is not intuitive and useful.
#146217 personal license

User avatar
MVV
Power Member
Power Member
Posts: 8160
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2013-03-25, 07:42 UTC

If we're talking about "one place", it should be Plugins tab of search template. It already handles regexp. In my plugin it will be "another place". And it will require to integrate large regexp library code into plugin. Anyway, plugin interface doesn't allow to use any user interface to set filter just before search.

AntonDudarenko
Member
Member
Posts: 106
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Post by *AntonDudarenko » 2013-03-25, 09:52 UTC

Hmmm, from one side I can understand your words: ok - Plugins tab of search template. So be it. But! right now I can choose your plugin on this tab - but IT does not contain any properties! Those I can't say "hey - if this file contains as a part of it's absolute path such 'folder/stRiNg', or such 'folder/folder2/STtrinG' - then ignore it during compare dirs operation"

And from other side: IF we should use this tab - for ANY of my paths - which I want to ignore - I should create new named template?
And this is should be a correct behavior from Ghisler's point of view?

Maybe we should create an enhancement topic|bug for this case?
#146217 personal license

User avatar
MVV
Power Member
Power Member
Posts: 8160
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2013-03-25, 12:54 UTC

My plugin doesn't provide any information fields. But there are a lot of others that do. You can use e.g. tc.fullname or tc.path for regex checking. It is built-in TC functionality so there's no need to duplicate it.

You can modify and resave template before rare sync operation or create new one for frequently used one.

Post Reply