ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael.Gir...@Bull.com
Subject Re: Unable to delete directory
Date Fri, 11 Jul 2003 14:55:11 GMT

Thanks for looking into this.

> +    /**
> +     * Attempt to fix possible race condition when deleting
> +     * files on WinXP. If the delete does not work,
> +     * wait a little and try again.
> +     */
> +    private boolean delete(File f) {
> +        if (! f.delete()) {
> +            try {
> +                Thread.sleep(10);
> +                return f.delete();
> +            } catch (InterruptedException ex) {
> +                return f.delete();
> +            }
> +        }
> +        return true;
> +    }


I pulled the 7/11 build, but this code did not appear in the source, so I
will wait for another build.

Looking at the proposed change, the only suggestion I would have is that
the sleep time should be configurable.  Perhaps through a property, or an
attribute of the delete task.

FWIW, I do have Norton Anti-Virus installed, but I disabled realtime
checking for some of my testing, and I continued to have the problem.
Using the same computer, the error did not occur using FAT32 drive, or when
using a network drive, so it seems to be something specific to local NTFS
drives.

Michael



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


Mime
View raw message