ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <>
Subject Comparing direcories / ${toString: ... } ?!
Date Wed, 25 Jan 2006 09:55:25 GMT


yet another file/dir compare question ;-)

i want to check whether two directory listings are equal,
means they contain the same set of files.

i've searched for the subject in the mailing list
archives but didn't find a solution that fits for me.

Now i have a working solution =

<!-- Import AntContrib -->
<taskdef resource="net/sf/antcontrib/antlib.xml" />

<target name="depends">

<fileset dir="T:/testdir1" includes="**/*.*"
id="dir1"defaultexcludes="false" />	
<fileset dir="T:/test/dir2" includes="**/*.*" id="dir2"
	<equals arg1="${toString:dir1}" arg2="${toString:dir2}"/>
		<echo>OK - Dirs are equal !!</echo>
		<echo>ERROR - Dirs don't match !!</echo>


Question =

some threads say that ${toString: ... } is a bit experimental,
so it should not be used.

But i like this solution, as it is short.

Is there a better solution ?


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

View raw message