Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.15.1
-
None
-
Windows 10 64-bit
-
-
5
-
71652ad4bf7b4cfe35473c3f93213c16e7653135 (qt/qtbase/dev) c2f5535cbb257f54dcdd8db2dc2c1d35230dce97 (qt/qtbase/6.2)
-
Team 2 Foundation_Sprint 43, Team 2 Foundation_Sprint 44
Description
Documentation says that if a dir exists, then `QDir::mkpath(path)` should return `true`. This however does not work for drives.
#include <QDebug> #include <QDir> int main() { qDebug() << QDir().mkpath("C:/Windows"); // returns true qDebug() << QDir().mkpath("C:/"); // returns false }
This hurts applicability. I cannot write `QDir().mkpath(parentDir);` to ensure that `parentDir` either exists or is created, unless I check beforehand whether the `parentDir` is a drive or a plain dir.
Attachments
Issue Links
- is cloned by
-
QTBUG-97110 QDir::mkpath() fails on MACOS given the root path
- Closed
- resulted in
-
QTBUG-96855 QWebEngineDownloadItem::setDownloadFileName failed in disk root
- Closed