Hi,
Can QDir create a directory with sub directories?
I have "/data" and I want to create "/data/dir1/subdir1"
Is there a way to create "dir1" and "subdir1" at same time or have I to create one by one?
Thanks,
Hi,
Can QDir create a directory with sub directories?
I have "/data" and I want to create "/data/dir1/subdir1"
Is there a way to create "dir1" and "subdir1" at same time or have I to create one by one?
Thanks,
Òscar Llarch i Galán
Hi,
See my tests:
QDir dir;
First Case: OK: The subdir test1 will be created successfully
if( !dir.mkdir("/root/test1") )
qDebug("error);
else
qDebug("ok"); // <<---- OK
Second Case: NO: The subdir test2 will not create successfully
if( !dir.mkdir("/root/test1/test2") )
qDebug("error); // <<--- ERROR
else
qDebug("ok");
Then I think that from the second level will have of to be created manually
have a look at QDir::mkpath()
Bookmarks