ANT 1.5 unable to delete directory

  • Thread starter Thread starter Michael Giroux
  • Start date Start date
M

Michael Giroux

I'm running Windows XP with 512 mb memory on 1ghz processor.

I am running an ANT script (www.apache.org) that creates a directory, unzips
several files into the directory, then later deletes the directory. the
delete is performed using the ANT <delete dir='classes'/> task.

The task fails because it gets an error trying to delete an empty
sub-folder. As the directive recurses through the sub-folders in the
classes directory, it deletes all the files, then deletes the empty folder.
ANT is getting an error trying to delete the empty folder.

Looking at the verbose output of the script, it actually appears that the
error occurs only when the last entry deleted (successfully) was also a
directory, but this may not be related.

ANT is a Java application, I'm not sure exactly what logic it might be using
to implement this <delete> task, but it seems there must be some API it is
calling that manages to cause an overlap between the time needed to delete
the last sub-folder, and the time ANT tries to delete the parent folder,
thus causing the delete to fail because of the outstanding reference.

Has anyone seen anything similar?
 
There may be a problem with "hidden" or "system" files in these
directories. Use ATTRIB * to see if there are any files left over
and use ATTRIB /-H /-S to unmark them so you can delete
them.
 
Back
Top