I own a Nokia N95 and I implemented a j2me function to delete a folder stored on the memory card (E: drive).
In case the folder is empty, the function works.
Otherwise, should not the folder be empty, I delete all of the files in folder and then I delete the folder itself.
Files are correctly deleted and the directory becomes empty (if I open the memory card, I find the empty folder) but despite it, when I try to delete the folder, the following exception occurs: "Directory is not empty".
Has anyone suggestions on how to solve this problem?
Thanks in advance.
String dir = "file:///E:/Dir/dir_to_delete";
FileConnection fileToDelete = (FileConnection) Connector.open(dir ,Connector.READ_WRITE);
Enumeration e = fileToDelete.list();
String file_2 = (String)e.nextElement();
FileConnection file = (FileConnection) Connector.open(dir + "/" + file_2 ,Connector.READ_WRITE);
form.append("Elemento: " + file_2 + "\n");
catch (IOException e)
form.append("Errore : " + e.getMessage());