Page 1 of 2

Error in directory filtering

Posted: Mon May 10, 2010 7:20 am
by calvini
Hi!

Changing on Windows 7 and doing some new comparisons for synchronizing user profiles, I came over the following:

I use absolute pathes for excluding folders, like: "\Admin\Appdata\*".

First error: When opening the multiline editor for editing the pathes, all leading '\' are removed. It's only possible to have them in the one-line-editing-mode. Minor error, though a little bit annoying.

Second error: Exclusions are only applied on existing source pathes. That means, excluding like above with source "\\PCFRST\Users\" and target "\\PC2SCND\Users\" will exclude all folders matching "\\PCFRST\Users\Admin\Appdata\*" from comparison. But, for example, if you have a folder "\\PCSCND\Users\Admin\Appdata\foo" with no corresponding "\\PCFRST\Users\Admin\Appdata\foo" this will show up in comparison, though it shouldn't, as it is excluded. Same happens, when the whole path doesn't exist, so if there is no "\\PCFRST\Users\Admin\Appdata", but a "\\PCSCND\Users\Admin\Appdata", it will be compared.
Works (resp. doesn't work) with absolute absolute ;) pathes too: Excluding a path "c:\source\foo\*" (the '*' may be omitted) when comparing "c:\source\" with "c:\target\" will work only when "foo" exists in "c:\source\". Having no "foo" in "c:\source\", but in "c:\target\" it will show up.
Serious error I think, as if something is excluded, it should be excluded even if it ist not there. Or is there any reason for this behaviour?

Kind regards
calvini

Re: Error in directory filtering

Posted: Sun May 16, 2010 9:24 pm
by calvini
Sorry for inquiring again - as I need this for some comparisons and I have to think about another solution if this isn't an error: Can you reproduce the described behaviour or am I the only one seeing it? If you can reproduce it - is this they way it is supposed to work?

Re: Error in directory filtering

Posted: Mon May 17, 2010 9:07 am
by calvini
Seems to be somehow related to this topic.

Re: Error in directory filtering

Posted: Mon May 17, 2010 11:18 am
by grigsoft
Hello,
Sorry for delay, I have missed this topic. Wasn't this fixed in current beta - http://www.grigsoft.com/wndsyncbu.zip ?

Re: Error in directory filtering

Posted: Mon May 17, 2010 11:24 am
by calvini
Hi!

Thank you for answering, I will check the beta and tell you the results asap.

Re: Error in directory filtering

Posted: Mon May 17, 2010 11:34 am
by calvini
Nope, isn't fixed.

Checked it with a simple testcase:
Source: C:\Users\foo\AppData\Local\Temp\src
Target: C:\Users\foo\AppData\Local\Temp\trg
Exclude: C:\Users\foo\AppData\Local\Temp\src\foo\*
Folder "foo" (with one file in it) exists in target, but not in source => it shows up
Adding empty folder "foo" to source => "No files were found to synchronize!"

Re: Error in directory filtering

Posted: Mon May 17, 2010 11:51 am
by grigsoft
Well, if you specify full path in exclude, of course it will list it on target. What is strange, is that it works with "\foo" and "foo*", but do not work with plain "foo". I will check this.

Re: Error in directory filtering

Posted: Mon May 17, 2010 12:06 pm
by calvini
grigsoft wrote:Well, if you specify full path in exclude, of course it will list it on target.
I don't think so - as the target "C:\Users\foo\AppData\Local\Temp\trg\foo\*" is compared against the source "C:\Users\foo\AppData\Local\Temp\src\foo\*" and the latter one is excluded, is should not show up. Just as it does, if I have an empty folder "foo" in the source.
grigsoft wrote:What is strange, is that it works with "\foo" and "foo*", but do not work with plain "foo". I will check this.
In my testcase above, all short versions ("\foo", "\foo*", "foo" and "foo*") work (means: exclude the path even if it doesn't exist in source).

Re: Error in directory filtering

Posted: Mon May 17, 2010 12:20 pm
by calvini
Another testcase - adding another folder "bar" to target:
trg\
__foo\
____foo.txt
____bar\
______bar.txt

Same as above:
no "foo" in source => will show up whole branch of target
but when adding an empty folder "foo" to source => "No files were found to synchronize!"

According to the argumentation "if you specify full path in exclude, of course it will list it on target." in the second case the file "trg\foo\bar\bar.txt" should be shown, as it isn't matched by the full path because it doesn't exist in source. Looks like only the "base"-path (infront of the '*') is treated specially. All after that is excluded regardless if it exists or not.

Re: Error in directory filtering

Posted: Mon May 17, 2010 12:40 pm
by grigsoft
The problem is current implementation - source folder is scanned, each folder is checked by exclude rules. Then target folder is scanned for missed folders, again each found folder is checked for exclude rule. So missing src folder will not be checked. That's not a big problem, I can handle it this way too.

Re: Error in directory filtering

Posted: Mon May 17, 2010 1:19 pm
by calvini
I thought about something like that - maybe the easiest way would be to map each target-folder to it's corresponding soure-name and vice versa and check the rules for both lists of names (in the current case with excluding both if one of them matches).

As I saw, when exchanging target and source, the situation will become even more tricky - excluding folders by absolute target-names doesn't work at all?

Correction - it works in the way you explained the workflow: Excluding an absolute target-name only works, if the name doesn't appear in source, as only then it is processed on the target. Which for example means, having target "foo" with no corresponding "foo" in source and excluding that by an absolute target-name works as expected. But adding an empty folder "foo" to source will show the files in "trg\foo", as then that folder gets processed on the source and so doesn't match the exclude-path from target.

By the way: The error with removing leading "\" (as mentioned in my first post) doesn't appear in the new version - was that fixed?

Re: Error in directory filtering

Posted: Mon May 17, 2010 1:29 pm
by grigsoft
Well, I guess you are right, full target path will only work for folders which are not on source.

Re: Error in directory filtering

Posted: Mon May 17, 2010 1:34 pm
by calvini
Changed my previous post while you were answering - sorry. But it looks like we've found out the same thing ;).

Re: Error in directory filtering

Posted: Wed May 19, 2010 8:44 pm
by calvini
The problem with the leading "\" deleted is already solved with the new version.

Re: Error in directory filtering

Posted: Wed Oct 27, 2010 7:38 am
by calvini
I got a notification because of a new reply on this topic - but there is none. Is the forum-software buggy?