I'm running this code on windows 7 pro:
foreach(QString str, directorie.entryList(QStringList(), QDir::Dirs))
{
if(str != "." && str != "..")
{
QDir path(directorie.path() + "\\" + str + "\\" + from.path());
if(path.exists())
{
QDir toPath(directorie.path() + "\\" + str + "\\" + to.path() + "\\" + path.dirName());
QDir make(directorie.path() + "\\" + str);
qDebug() << make.mkpath(to.path() + "\\" + path.dirName());
QDir dir;
qDebug() << dir.rename(path.path(), toPath.path()) << path.path() << toPath.path();
}
}
}
For every directories I try to move, rename return false
I check : The old path exist, the new path is created. I have enough rights on both directories.
The directorie is on another server (it start with "\\"). It work to copy to that directorie from anywhere (even from a completely different server)
Anyone know why it doesn't work ? What did I do wrong ? Do you have any alternative solution ?
EDIT : For mysterious reason, it doesn't make the toPath anymore