Oh, yes, I see now.
That will not work because at that point the parent dir is possible not to be empty, therefore the call will fail.
Do it like I have shown you.
Another solution is:
void Form1::DeleteData(String dirViewPath)
{
...
//function body
...
if(!dirPath.count()==2) //"." and ".." -- might not be the case. if not,. test with 0
{
dirPath.cdUp();
dirPath.rmdir(dirViewPath);
}
}
void Form1::DeleteData(String dirViewPath)
{
...
//function body
...
if(!dirPath.count()==2) //"." and ".." -- might not be the case. if not,. test with 0
{
dirPath.cdUp();
dirPath.rmdir(dirViewPath);
}
}
To copy to clipboard, switch view to plain text mode
This will work. I forgot to mention that you have to go one level above dirViewPath, in order to delete it.
Regards
Bookmarks