ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Al Le <al...@gmx.de>
Subject Re: "Sync" sometimes does not delete folders
Date Sun, 18 Sep 2016 22:35:21 GMT
> 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-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message