Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] QDir "File access error" (Qt 5.2.0)

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

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.0k Views
  • 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 Offline
    X Offline
    xtingray
    wrote on last edited by
    #1

    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
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      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
      0
      • X Offline
        X Offline
        xtingray
        wrote on last edited by
        #3

        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
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved