# Run action only if source file is newer than output file

**URL:** https://www.finalbuilder.com/forums/t/run-action-only-if-source-file-is-newer-than-output-file/1459
**Category:** Discussion
**Created:** [April 7, 2010, 4:37am UTC](https://www.finalbuilder.com/forums/t/run-action-only-if-source-file-is-newer-than-output-file/1459 "2010-04-07T04:37:51Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![larsac](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/b9bd4f/32.png) [@larsac](https://www.finalbuilder.com/forums/u/larsac)
#### Post date: [April 7, 2010, 4:37am UTC](https://www.finalbuilder.com/forums/t/run-action-only-if-source-file-is-newer-than-output-file/1459/1 "2010-04-07T04:37:51Z")

</div>

Hello,

I would like to run a compiler on a set of source files, but only if the source file has changed more recently than the corresponding object file.

Basically I am thinking of iterating over a FileSet using a variable SourceFile, determine the filename of ObjectFile from SourceFile and perform an action only, if the modification date of SourceFile is more recent than that of ObjectFile. However, the If..Then-Action does not seem to provide an expression like "is newer than" or similar.

Thanks in advance and best regards, Lars

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [April 7, 2010, 11:19am UTC](https://www.finalbuilder.com/forums/t/run-action-only-if-source-file-is-newer-than-output-file/1459/2 "2010-04-07T11:19:56Z")

</div>

Hi Lars   
  
 The File Dependency Action in FB6 Professional Edition will do exactly what you need.

---

<div class="post-metadata">

### Author: ![larsac](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/b9bd4f/32.png) [@larsac](https://www.finalbuilder.com/forums/u/larsac)
#### Post date: [April 8, 2010, 5:22am UTC](https://www.finalbuilder.com/forums/t/run-action-only-if-source-file-is-newer-than-output-file/1459/3 "2010-04-08T05:22:12Z")

</div>

Thanks a lot, overlooked that one.

Lars
