Performed some tests to better understand "filter".
I created a folder with 9 folders (names: 111, 222, ..., 999) and 9 files (names: 111.txt, 222.txt, ..., 999.txt).
Each subfolder (111 - 999) contains some files and folders too (names not relevant).
Filter setting
Include:
*
Exclude:
111*:
\222*:
*\333*:
444*\
\555*\
*\666*\
777*
\888*
*\999*
"Compare" execution
1. filter settings regarding 111, 222 and 333 seem to work exactly the same way, and they exclude only files (not folders).
2. same for 444, 555 and 666 where only folders are excluded (not files).
3. same for 777, 888 and 999 where both files and folders are excluded.
Now a simple question
Why 3 different notations (patterns) for the same model?
E.g. referring to the 3rd case (777, 888, 999) I can easily understand: "777*" and "\888*", but not at all: "*\999*" ...
Anyway it would be better to have only 1 notation (and I find by logical point of view "777*" really clear).
Now what seems to me a bug
The case 111, 222 and 333 excludes the files and shows the folders - and that is correct - but doesnt show the content (files and folders) of the shown folders.
I mean:
I can see folders 111, 222 and 333
Folder 111 contains a folder named xxx and a file named yyy.txt
1. xxx is selected for the copy (not excluded) - CORRECT
2. yyy.txt is not selected for the copy (so: excluded) - WRONG (Why?)
Executing the sync, in the folder 111 only the subfolders will be copied too, NOT THE FILES.
I used the "plural" because I completed the test with more levels of nested subfolders / files.
I hope I provided a clear explanation.
P.S.: updating the example page (https://freefilesync.org/manual.php?topic=exclude-files) with the 9 UseCases I listed, could help the users ...
regarding "filter" (maybe bug)
-
- Posts: 11
- Joined: 22 Nov 2017
- Posts: 4910
- Joined: 11 Jun 2019
"\999" is going to be a subset of "*\999" and produces no difference in your limited dataset. Just because:
111*:
\111*:
*\111*:
all end up with the same result in your tests, doesn't mean they are the same. If you had a '111' subdirectory inside '222', you'd start seeing some differences.
As for your "bug", it isn't a bug.
The relative path for yyy.txt is "\111\yyy.txt"
The filter "111*:" is going to exclude all files where the path to it matches, and "111*" matches anything with a path beginning with "\111" since root is always implied. Thus, excluded
111*:
\111*:
*\111*:
all end up with the same result in your tests, doesn't mean they are the same. If you had a '111' subdirectory inside '222', you'd start seeing some differences.
As for your "bug", it isn't a bug.
The relative path for yyy.txt is "\111\yyy.txt"
The filter "111*:" is going to exclude all files where the path to it matches, and "111*" matches anything with a path beginning with "\111" since root is always implied. Thus, excluded