Hello All,

I'm trying to create a directory structure using the following code, but it sometimes fails, I would like to know why?
Qt Code:
  1. QDir dir;
  2. bool ok = dir.mkpath(path); //this function creates the path, with all its necessary parents;
  3.  
  4. if(!ok)
  5. {
  6. //error message, could not create the required directory structure!
  7. QMessageBox::critical(this, tr("Error!"), tr("Error creating directory structure"));
  8. return;
  9. }
To copy to clipboard, switch view to plain text mode 

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