Hi,

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"
defaultexcludes="false"/>
        
<if>
        <equals arg1="${toString:dir1}" arg2="${toString:dir2}"/>
        <then>
                <echo>OK - Dirs are equal !!</echo>
        </then>
        <else>
                <echo>ERROR - Dirs don't match !!</echo>
        </else>
</if>

</target>

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 ?


bye4now,
Gilbert

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to