ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy-Lambert <>
Subject Re: compare files from 2 directories
Date Fri, 25 Feb 2011 21:17:14 GMT
If you want to compare two directories using ant, you can do this by 
using the present and the different selectors.

<!-- 1 - find files which are in directory bar but not in foo see [1] -->

<fileset dir="bar" id="onlyinbar">
<present present="srconly" targetdir="foo"/>
<echo>these files are only in bar : ${toString:onlyinbar}</echo>

<!-- 2 - find files which exist in both bar and foo but are different -->

<fileset dir="foo" id="differentbarfoo">
     <different targetdir="bar"

<echo>these files are different in bar compared to foo : 




On 2/25/2011 10:32 AM, ritchie wrote:
> I want to check files from 2 directories for filematch, I tried using
> checksum task but it does not work for 2 directories. Is it possible to
> attain this by using ant alone?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message