ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bevan Arps <>
Subject How to delete existing files
Date Fri, 20 Apr 2001 21:53:13 GMT

Given two directories A and B how do I use Ant to delete all files in B
that also exist in A?


If A contains the files: one.file, two.file, three.file
and B contains the files: one.file, three.file, fish.file

I want to delete one.file and three.file from B.

I haven't been able to work out how to achieve this and haven't found
anything like this in the mailing list archive, so any ideas would be

I tried this:

<delete dir="B">
  <fileset dir="A">
    <include name="*"/>

But this deleted all the files in both A and B. :-(

Then I tried this 

<delete dir="B">
  <fileset dir="A">
    <include name="*"/>
  <mapper type="flatten"/>

But delete doesn't support mappers. 

Any ideas?


Bevan Arps, OO Analyst                    email:
ACT Financial Systems     "Programming is an Art Form that Fights Back"
This  communication  is confidential  to ACT  Financial  Systems  (Asia
Pacific)  and is intended for  use only by the  addressee.   The  views
and opinions  expressed in  this email  are the senders  own and do not
represent  the  views  and  opinions of  ACT  Financial  Systems  (Asia

View raw message