diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 4fa4af82f29..abcc82dd408 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -1078,6 +1078,11 @@ bool QFileSystemEngine::cloneFile(int srcfd, int dstfd, const QFileSystemMetaDat static bool createDirectoryWithParents(const QByteArray &nativeName, mode_t mode, bool shouldMkdirFirst = true) { +#ifdef Q_OS_WASM + if (nativeName.length() == 1 && nativeName[0] == '/') + return true; +#endif + // helper function to check if a given path is a directory, since mkdir can // fail if the dir already exists (it may have been created by another // thread or another process) diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index 892d442739f..da83ca898a0 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -522,9 +522,6 @@ void tst_QDir::makedirReturnCode() // the next line specifically targets Windows and macOS (QTBUG-85997, QTBUG-97110) // calling mkpath on an existing drive name (Windows) or root path (macOS) shall pass -#ifdef Q_OS_WASM - QEXPECT_FAIL("", "fails on wasm, see bug QTBUG-127767", Continue); -#endif QVERIFY(QDir().mkpath(QDir::rootPath())); QVERIFY(!QDir().mkdir(QDir::rootPath()));