QDir spawning dir when not existing.
It sounds real easy, and as the Doc states it should work like this, but all I get is "unable to spawn"
Code:
if (!dir.exists()){
qDebug() << "Dir " << _basedir << " does NOT exists";
if (dir.mkpath(_basedir)){
qDebug() << "Spawned base dir " << _basedir;
}
else{
qDebug() << "Unable to spawn base dir " << _basedir;
return;
}
}
}
Note: _basedir may be absolute or relative
may somone please point me to my mistake, I don't really see any.
I allready read the doc twice, but I don't see any hint about this..
thanks for any reply
Re: QDir spawning dir when not existing.
Hi
I tried your code on my win Xp machine with 4.6.0 and it works fine for absolute as well as relative path however i had to change
Quote:
#
void blah(const QString &basedir){
to _basedir.
That may not be the problem or may be it is ? can you check if you already have this _basedir variable globally declare with some different values ?
i am assuming that your function parameter should be _basedir. correct me if i m wrong.
Re: QDir spawning dir when not existing.
You are right, but that's not the point, I just picked it from a class method to a function vereyone could easily test. Fixed typo.
I am on Linux and I'd like to hear some voice testing that on linux/*nix systems.