Page 1 of 1

Exclude subfolders

Posted: Fri Feb 16, 2024 8:36 pm
by JmK
Just purchased a copy and am trying to work through filter exclusions.
Is there a mask that I can use to exclude all subfolders with a particular name. I imagine it would be something along the lines of *\bin\*.*

E.g. I would like to exclude all subfolders named "bin" and the result should be the exclusion of these folders:
\Test\android\bin
\Test\ios\bin
\Projects\Build\Output\bin

Thanks!

Re: Exclude subfolders

Posted: Fri Feb 16, 2024 8:52 pm
by tobias
The best way is to type just

bin

This will exclude all items named bin everywhere, and of course subfolders too.

Re: Exclude subfolders

Posted: Sat Feb 17, 2024 9:12 am
by JmK
Thank you for the prompt reply!

That will probably work for most of the scenarios I need.
It would be perfect if I had a way of excluding just folders. This is good enough though.

Re: Exclude subfolders

Posted: Sat Feb 17, 2024 10:53 am
by tobias
Hello,
yes this will be made more flexible in a future version.

Special requirements can currently be fulfilled with a PascalScript function. For example, to exclude only bin folders:

Code: Select all

function OnIncludeItem(const FileName, RelativePath: UnicodeString;
        const isRightSide, isFolder:Boolean;
        const FileSize:Int64; const FileAttr:LongWord;
        const Connector: Opaque):Boolean;
begin
  Result:=not isFolder or (FileName<>'bin');
  end;
This can be added to the profile via "Job->PacalScript..." .

However if you have a really large number of files, the script might slow down the scanning process. This is definitely slower than the exclusion mask which I recommended.

See also
https://www.syncovery.com/pascalscript/

Re: Exclude subfolders

Posted: Sun Feb 18, 2024 2:42 pm
by JmK
"yes this will be made more flexible in a future version."

Excellent! :D

Re: Exclude subfolders

Posted: Mon Feb 19, 2024 10:43 am
by User
tobias wrote:
Fri Feb 16, 2024 8:52 pm
The best way is to type just

bin

This will exclude all items named bin everywhere, and of course subfolders too.
So there's no difference between "*bin*" and just "bin" without the "*"?

Re: Exclude subfolders

Posted: Mon Feb 19, 2024 6:51 pm
by tobias
Hi,
yes there is a big difference.

*bin* would exclude files and folders named for example
Robin Hood
Binary Files
dump.bin

But bin excludes just bin.

You could theoretically type *\bin\* but there is no reason to do it. It only makes the processing unnecessarily complicated.