Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QTemporaryDir reasons for not valid/fail to create?



  • Using Qt 5.12 MSVC 2015 on Windows10 Pro 64bit.

    I've been debugging an intermittent issue in my app.

    99.9% of the time it seems, QTemporaryDir successfully creates a directory in the user's temp folder (c:\users\user\AppData\local\Temp<unique name> on construction.

    When my failure hits, it's because it doesn't.. I've found now the isValid() check, which I will begin using, but what if isValid returns false? Why did it fail? Do I simply make a new QTemporaryDir construction and try to use that? What are some reasons why the temporary dir would fail to create on an intermittent basis? (ie. not a permissions or lack of disc space problem.)

    Thanks


  • Lifetime Qt Champion

    Hi,

    You can use the errorString method to get the reason of the failure.


Log in to reply