Delete directory on windows
I need help...
I'm writing a project to make a directory synchronizer, with many policy.
I have to write a method to delete all the input directory, and i write this:
publicboolean deleteDir(File dir){
if (dir.isDirectory()){
String[] children = dir.list();
for (int i=0; i<children.length; i++){
boolean success = deleteDir(new File(dir, children[i]));
if (!success)returnfalse;
}
}
// The directory is now empty so delete it
System.gc();
return dir.delete();
}
So i test it and the result is:
on Linux Debian it will delete all the directory
on Windows Xp no.
I tried to change dir.delete() in to dir.deleteOnExit() but it's the same, it doesn't work on win!!!!
I have no ideas, please help me.>

