[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 567
  • Last Modified:

ANT NEWBIE: How to overwrite on copy regardless of timestamp?

Dear Experts,

I'm an Ant dummy...

I have a working Ant that builds my project, and then additionally copies the classes to a remote box.  However, the TIME on the remote box keeps getting ahead of my time.  And it appears that the copy fails whenever that happens.  I can only assume that Ant is comparing the timestamps of the matching files, and not overwriting what it thinks are "later" files.

How can I tell it to overwrite regardless?

This is the Ant snippet;

    <copy todir="\\MyRemoteBox\MyProduct\bin">
     <fileset dir=".\classes"/>

Thanks!
BrianMc1958

0
BrianMc1958
Asked:
BrianMc1958
  • 3
1 Solution
 
girionisCommented:
Hi BrianMc1958

You could delete the classes in the remote box befor you attempt to copy them, just use the <delete> task with the <fileset> element.

Cheers
0
 
girionisCommented:
Have a look here: http://ant.apache.org/manual/CoreTasks/delete.html for more info
0
 
BrianMc1958Author Commented:
Works!
--BrianMc1958
0
 
girionisCommented:
:-)
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now