ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vikas Phonsa <VPho...@suz.com>
Subject RE: Help to do a logical reverse of a copy but really a delete
Date Thu, 25 Sep 2003 21:15:48 GMT
Sorry I didn't understand your point but maybe this will show some direction
to u

<copy todir="${destination}">
          <fileset dir="${copyFrom}"/>
        </copy>
        <delete>
          <fileset dir="${destination}">
            <not>
              <present targetdir="${copyFrom}"/>
            </not>
          </fileset>
        </delete>


I am using this to copy files from one directory to another and then delete
from the destination all the files that were present in destination but are
not present in the source directory. So all additional files in destination
are deleted.

Another version of this logic might work for you.

Vik





-----Original Message-----
From: kyles [mailto:kyle@customsoftinc.com] 
Sent: Thursday, September 25, 2003 2:08 PM
To: user@ant.apache.org
Subject: Help to do a logical reverse of a copy but really a delete

Hello,

I want to delete selected files from a directory that also are to be found
in another directory, how to do this?

In short I have done an Ant 'copy' task such as:

    <copy todir="${target}">
      <fileset dir="${source}" />
    </copy>

Later I want to delete from 'target' the files copied there from 'source'.

I basicly want to 'undo' the copy.

I have looked at the delete task but it is not clear to me how I can use a
file set from another directory as a guide to delete from yet another
directory.

How can I undo a copy operation?

Thanks in advance.




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message