# Delete files recursively

**URL:** https://www.finalbuilder.com/forums/t/delete-files-recursively/3839
**Category:** Feature Requests
**Created:** [March 9, 2007, 4:54am UTC](https://www.finalbuilder.com/forums/t/delete-files-recursively/3839 "2007-03-09T04:54:31Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![stevage](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@stevage](https://www.finalbuilder.com/forums/u/stevage)
#### Post date: [March 9, 2007, 4:54am UTC](https://www.finalbuilder.com/forums/t/delete-files-recursively/3839/1 "2007-03-09T04:54:31Z")

</div>

Strangely, in the set of actions Delete File(s), Delete Directory, FileSet Delete Files, there doesn’t seem to be an easy way to recursively delete files matching a filemask. In fact, the easiest way appears to be to create a zip directory, using the “recurse directory” and “remove files” options, then delete the zip afterwards. Hmm…🙂  
  
Steve

---

<div class="post-metadata">

### Author: ![pj\_kwiksystems](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/a698b9/32.png) [@pj\_kwiksystems](https://www.finalbuilder.com/forums/u/pj_kwiksystems)
#### Post date: [March 9, 2007, 9:42am UTC](https://www.finalbuilder.com/forums/t/delete-files-recursively/3839/2 "2007-03-09T09:42:20Z")

</div>

I believe this was a deliberate deisgn decision to avoid problems if/when users accidently manage to delete large chunks of work and blame FinalBuilder.  
  
Kithran

---

<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: [March 12, 2007, 5:07am UTC](https://www.finalbuilder.com/forums/t/delete-files-recursively/3839/3 "2007-03-12T05:07:18Z")

</div>

correct.

---

<div class="post-metadata">

### Author: ![miracle2k](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/miracle2k/32/76_2.png) [@miracle2k](https://www.finalbuilder.com/forums/u/miracle2k)
#### Post date: [March 13, 2007, 9:54am UTC](https://www.finalbuilder.com/forums/t/delete-files-recursively/3839/4 "2007-03-13T09:54:57Z")

</div>

With the risk of stating the obvious, defining a fileset with a recursive include pattern does not what you want to accomplish?

---

<div class="post-metadata">

### Author: ![stevage](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@stevage](https://www.finalbuilder.com/forums/u/stevage)
#### Post date: [March 14, 2007, 3:25am UTC](https://www.finalbuilder.com/forums/t/delete-files-recursively/3839/5 "2007-03-14T03:25:41Z")

</div>

Ah, very interesting. Yes, looks like a recursive fileset would work, thanks. Which kind of makes the design decision moot, but anyway…  
  
Steve

---

<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: [March 14, 2007, 6:09am UTC](https://www.finalbuilder.com/forums/t/delete-files-recursively/3839/6 "2007-03-14T06:09:01Z")

</div>

shhhh…

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [March 16, 2007, 6:42am UTC](https://www.finalbuilder.com/forums/t/delete-files-recursively/3839/7 "2007-03-16T06:42:21Z")

</div>

And there goes the cat…

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [May 7, 2007, 9:21am UTC](https://www.finalbuilder.com/forums/t/delete-files-recursively/3839/8 "2007-05-07T09:21:59Z")

</div>

There is an ugly thing to this: In the delete FileSet, you cannot delete readonly flies. In my case I want to clean the Visual Studio webdeploy directory from horrible \*scc files. Now I use a DeleteFile(s) and a folder iterator in combination with a DeleteFile(s) action.  
I agree in the past it was a risky operation. But I think with the standards of today (separate recoverable build machine), and the excelent variable-insight, or whatever it is called, the changes of making a buisness-breaking error are zero. Please put it in!
