Re: "Sync" sometimes does not delete folders

Al Le <[email protected]>
Newsgroups gmane.comp.jakarta.ant.user
Message-ID <[email protected]>
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.