Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-66580

Incorrect QFile::isReadable() for files in a resource

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.6.3, 5.7.1, 5.9.3
    • Core: I/O
    • None
    • Windows 10

      Qt 5.9.3 (mingw)

      Qt 5.7.1 (mingw)

      Qt 5.6.3 (mingw)

    Description

      Calling QFile::isReadable() on a file located in a resource returns false, although QFileInfo::isReadable() for the same file returns true

          QFile file{":/test.txt"};
      
          qDebug() << "QFile::exists():" << file.exists();   // true
          qDebug() << "QFile::isReadable():" << file.isReadable();  // false
          qDebug() << "QFile::isWritable():" << file.isWritable();  // fakse
      
          QFileInfo fileInfo{":/test.txt"};
      
          qDebug() << "QFileInfo::exists():" << fileInfo.exists(); // true
          qDebug() << "QFileInfo::isReadable():" << fileInfo.isReadable(); // true
          qDebug() << "QFileInfo::isWritable():" << fileInfo.isWritable(); // false
      

      See attachment with a minimal example to reproduce the problem

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            dpurgin Dmitriy Purgin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes