Exclude subfolders

General Discussion in English
Post Reply
JmK
Posts: 3
Joined: Fri Feb 16, 2024 8:12 pm

Exclude subfolders

Post 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!

tobias
Posts: 1789
Joined: Tue Mar 31, 2020 7:37 pm

Re: Exclude subfolders

Post by tobias »

The best way is to type just

bin

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

JmK
Posts: 3
Joined: Fri Feb 16, 2024 8:12 pm

Re: Exclude subfolders

Post 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.

tobias
Posts: 1789
Joined: Tue Mar 31, 2020 7:37 pm

Re: Exclude subfolders

Post 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/

JmK
Posts: 3
Joined: Fri Feb 16, 2024 8:12 pm

Re: Exclude subfolders

Post by JmK »

"yes this will be made more flexible in a future version."

Excellent! :D

User
Posts: 6
Joined: Wed Aug 30, 2023 12:00 pm

Re: Exclude subfolders

Post 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 "*"?

tobias
Posts: 1789
Joined: Tue Mar 31, 2020 7:37 pm

Re: Exclude subfolders

Post 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.

Post Reply