PDA

View Full Version : QDir not working as expected



BettaUseYoNikes
24th August 2011, 17:49
This is what I have been doing, the directory does exist but then the folder is never created by the mkdir functions. Maybe I am missing something trivial but I cannot seem to find many examples on this using QDir.

pathname = C:\Documents and Settings\wrightc\Desktop\TESTS
folder = Test*_Results;

QDir directory(QString::fromStdString(pathname));
if(directory.exists()){
directory.mkdir(QString::fromStdString(folder));
}

MasterBLB
24th August 2011, 17:55
Maybe I am missing something trivial(...)
Yes,you are.
Use / instead of \
And * is illegal character for a filename on Windows

wysota
24th August 2011, 17:55
Does your filesystem accept "*" as part of directory name?