ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vikas Phonsa <>
Subject RE: Ant Copy
Date Fri, 15 Aug 2003 16:00:56 GMT
Ok David,
I had read abt and worked with Ant copy task before I posted this message. I
understand its functions, but I have unique situation at hand so I was
looking for some means to achieve that, copy task or no copy task.

I know I could first delete all the files in the destination and then copy
to it so that the destination doesn't have the unwanted files anymore. But
that's not an option. 

-----Original Message-----
From: Harkness, David [] 
Sent: Thursday, August 14, 2003 5:44 PM
To: Ant Users List
Subject: RE: Ant Copy

Okay, I'll take a stab at it.

First, <copy> is not a synchronization task -- it only copies files and
directories. Thus, you cannot do what you're trying to do (make one
directory look like another). To be clear, it will *not* result in
deleting a file *ever*. Perhaps you want to delete the directory
entirely from project1 and then copy it from project2 to project1?

Second, I do believe that <copy> checks the modification times of times
and copies only newer files, but I'm not sure. Have you checked the
docs? Let's see ... 

``Copies a file or FileSet to a new file or directory. By default, files
are only copied if the source file is newer than the destination file,
or when the destination file does not exist. However, you can explicitly
overwrite files with the overwrite attribute.''

Look at that: second sentence of the first paragraph of <copy>'s
documentation. I know, you were too busy to read the documentation, eh?

David Harkness
Sony Pictures Digital Networks
(310) 482-4756

-----Original Message-----
From: Vikas Phonsa [] 
Sent: Thursday, August 14, 2003 5:04 PM
To: 'Ant Users List'
Subject: Ant Copy

Sorry guys I'm posting this issue again but I really need some ideas on
it. Please help.

I had files A,B,C in Project1 and were copies to Project2. In Project2 I
deleted the file C but added a new file D. Now when I copy back, Ant
would copy the new file D to Project1 and other files that were modified
but I need the file C that was deleted in Project2 to be deleted in
Project1 also after the  copying back task in completed.

Project1 should be exactly the same as Project2 after the reverse

I could first delete all the files in Project1 before copying the files
from Project2 and now Project1 would not have the deleted file C. But
deleting files from Project1 before copying to it is not an option.

Anybody done something similar. Do I write a new task ??

Any ideas ??


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

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

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

View raw message