# FileSet and dynamic exclude patterns

**URL:** https://www.finalbuilder.com/forums/t/fileset-and-dynamic-exclude-patterns/917
**Category:** Discussion
**Created:** [July 30, 2008, 11:11am UTC](https://www.finalbuilder.com/forums/t/fileset-and-dynamic-exclude-patterns/917 "2008-07-30T11:11:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![richardfloor](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/r/41988e/32.png) [@richardfloor](https://www.finalbuilder.com/forums/u/richardfloor)
#### Post date: [July 30, 2008, 11:11am UTC](https://www.finalbuilder.com/forums/t/fileset-and-dynamic-exclude-patterns/917/1 "2008-07-30T11:11:17Z")

</div>

Hello,

Is it possible to add exclude patterns to a fileset define while the script is running?

I'm looking for this option because it is possible that i want to add a file to the exclude list, but i don't want to change the script every time this is needed. When it isn't possible can i you then place this on the whislist.

Best regards,

Richard Floor

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [July 31, 2008, 3:28am UTC](https://www.finalbuilder.com/forums/t/fileset-and-dynamic-exclude-patterns/917/2 "2008-07-31T03:28:07Z")

</div>

Hi Richard,   
  
 It can be done - but it’s a bit hacky.   
  
 Define a new variable, say %ExcludeThisFile% and default it to a string which you are sure will not match any files, eg. “-------”   
  
 Then in the FileSet Define action add an Exlude Pattern and set %ExcludeThisFile% as the Filespec. And then if you need to exclude either a single file or files that match a mask just set %ExcludeThieFile% before the FileSet Define action runs. As I said… bit of a hack and will be a bit nasty if you have a lot of files that need to be excluded that don’t have anything in common (ie. so you can’t use a mask), but it should work.   
  
 hth.   
 .t8

---

<div class="post-metadata">

### Author: ![richardfloor](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/r/41988e/32.png) [@richardfloor](https://www.finalbuilder.com/forums/u/richardfloor)
#### Post date: [July 31, 2008, 8:12am UTC](https://www.finalbuilder.com/forums/t/fileset-and-dynamic-exclude-patterns/917/3 "2008-07-31T08:12:41Z")

</div>

Hi Tate,   
  
 Your idea sounds good and doable, but as you said when you have a lot of those exclusions then it is a teadius job. At the moment i have 13 exclusions and this good become more at any time. And i would have to make a lot of variables to fill the pre-defined exclusions and then iterate through a file to filll the variables that feed the exclusions. Then when the file becomes bigger then the number of exclusions you would have to edit the project again to make more variables and exclusions and so on.   
  
 So is it maybe possible to make an action that iterates through a file and that can modify a fileset to add the exclusions. This probably needs modifications in the filset define action.   
  
 Regards,   
  
 Richard Floor
