[SOLVED] QDir "File access error" (Qt 5.2.0)



  • I used to compile and run this code using Qt 4.8.x in a pretty clean way:
    @
    QDir projectDir("/tmp/test");
    if (!projectDir.exists()) {
    // Do something here
    }
    @

    Now, when I try to run the same code using Qt 5.2.0 I get this error message just before the crash:
    QIODevice::open: File access not specified

    Note: Line 2 is where the program crashes

    I tried to use the QFile.open() method to deal with this situation, but then I get the same error when I create an instance of QFile with the directory path.

    Is this a possible bug? how do I deal with this issue?

    Thanks!



  • If by "crash" you mean terminates abnormally then you need to run it in your debugger, inspect the backtrace when it crashes, and address the code that is actually triggering the crash.



  • Thank you! In my case, the issue is related to the Quazip wrapper :)
    @
    10 0x00007ffff3e6fdd5 in QObject::~QObject() () from /home/xtingray/Qt5.2.1/5.2.1/gcc_64/lib/libQt5Core.so.5
    11 0x00007ffff3d7fe82 in QFile::remove(QString const&) () from /home/xtingray/Qt5.2.1/5.2.1/gcc_64/lib/libQt5Core.so.5
    12 0x00007ffff014fc98 in JlCompress::compressDir(QString, QString, bool) () from /usr/lib/x86_64-linux-gnu/libquazip.so.0
    13 0x00007ffff2ea1034 in TupPackageHandler::makePackage(QString const&, QString const&) () from /usr/local/tupi/lib64/tupi/libtupi.so.1
    @


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.