# Nuby Rake questions about FileList or File task

**URL:** <https://www.ruby-forum.com/t/nuby-rake-questions-about-filelist-or-file-task/154859>\
**Category:** Ruby\
**Created:** [December 4, 2008, 4:24pm UTC](https://www.ruby-forum.com/t/nuby-rake-questions-about-filelist-or-file-task/154859 "2008-12-04T16:24:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bob\_Archer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/c68b51/32.png) [@Bob\_Archer](https://www.ruby-forum.com/u/Bob_Archer)\
**Post date:** [December 4, 2008, 4:24pm UTC](https://www.ruby-forum.com/t/nuby-rake-questions-about-filelist-or-file-task/154859/1 "2008-12-04T16:24:08Z")

</div>

Hello all,

It was recommended that I post rake questions here. I couldn’t find a  
rake specific mail list. If there is one, please point me to it.

I am creating a rake script and my .Net app test projects have  
app.config.template files that I want to rename to app.config but only  
if app.config doesn’t already exist.

So, I am doing the following:

```
        FileList['**/app.config.template'].each do |src|

                                cp src,

```

“#{File.dirname(src)}/app.config” unless  
File::exist?("#{File.dirname(src)}/app.config")

```
                    end

```

It does work… but seems like I should be able to do this with a rule or  
File task… but I can’t figure out how. Should I just stick with the  
above?

Also, what is the order that stuff that is in the rakefile but not in a  
task will run. If I want this to happen no matter what task is run  
should I put it before any tasks, or does it not matter? Or, should I  
really put the above into my compile task?

Finally, I am confused about a File task. Does this run all the time, or  
does it need to be called?

Thanks,

BOb
