yazwas
28th August 2009, 17:05
Hello All,
I'm trying to create a directory structure using the following code, but it sometimes fails, I would like to know why?
QDir dir;
bool ok = dir.mkpath(path); //this function creates the path, with all its necessary parents;
if(!ok)
{
//error message, could not create the required directory structure!
QMessageBox::critical(this, tr("Error!"), tr("Error creating directory structure"));
return;
}
How can I get the reason for mkpath returning false, what is the function that I need to call to figure out what was the problem?
Thanks
I'm trying to create a directory structure using the following code, but it sometimes fails, I would like to know why?
QDir dir;
bool ok = dir.mkpath(path); //this function creates the path, with all its necessary parents;
if(!ok)
{
//error message, could not create the required directory structure!
QMessageBox::critical(this, tr("Error!"), tr("Error creating directory structure"));
return;
}
How can I get the reason for mkpath returning false, what is the function that I need to call to figure out what was the problem?
Thanks