Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

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

    General and Desktop
    2
    3
    1811
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • X
      xtingray last edited by

      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!


      Qt Developer

      1 Reply Last reply Reply Quote 0
      • C
        ChrisW67 last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • X
          xtingray last edited by

          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
          @


          Qt Developer

          1 Reply Last reply Reply Quote 0
          • First post
            Last post