G.5 Different

The <different> selector will select a file if it is deemed to be 'different' from an equivalent file in another location. The rules for determining difference between the two files are as follows:

This is a useful selector to work with programs and tasks that don't handle dependency checking properly; even if a predecessor task always creates its output files, followup tasks can be driven off copies made with a different selector, so their dependencies are driven on the absolute state of the files, not just a timestamp. For example: anything fetched from a web site, or the output of some program. To reduce the amount of checking, when using this task inside a <copy> task, set preservelastmodified to true to propagate the timestamp from the source file to the destination file.

The <different> selector supports the use of a contained <mapper> element to define the location of the file to be compared against. If no <mapper> element is specified, the identity type mapper is used.

<fileset dir="${phing.1.5}/classes" includes="**/*.php">
            <different targetdir="${phing.1.4.1}/classes"

Table G.5:  Attributes for the <different> selector

targetdirThe base directory to look for the files to compare against. The precise location depends on a combination of this attribute and the mapper element, if any.n/aYes
ignoreFileTimesWhether to use file times in the comparison or not.trueNo
ignoreContentsWhether to do a byte per byte compare.falseNo