Windows does not allow one to delete a file if there is a process that has
an open handle to it


Thank you for the hint! I'll check whether the dir is locked by a process.

I do not know if the sync
task checks if file deletions actually succeed. It is common for Java
programs to not check the return value of a delete operation (File#delete())
to verify it actually worked.

I see that the sync task does not check the return code. Here's an excerpt from the source (https://github.com/apache/ant/blob/master/src/main/org/apache/tools/ant/taskdefs/Sync.java, line 246):

   log("Removing orphan directory: " + f, Project.MSG_DEBUG);
   f.delete();
   ++removedCount[0];

I saw a macro (macrodef) on the internet which mimics the sync behaviour by combining copy and delete tasks, I'll give it a try.

AL

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

Reply via email to