Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
5.11.3
-
None
Description
The OS where the issue has been tested is:
PRETTY_NAME="Debian GNU/Linux 10 (buster)" NAME="Debian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=debian
The QT version is:
QMake version 3.1 Using Qt version 5.11.3 in /usr/lib/x86_64-linux-gnu
The testing code is "file_info.cpp", it checks the user provided path propeties, including if the path is a directory or no. It uses the function "QFileInfo::isDir()", which is providing a wrong result for directories. The code is:
#include <QTextStream> #include <QFileInfo> #include <iostream> using namespace std; int main(int argc, char *argv[]) { QTextStream out{stdout}; if (argc != 2) { out << "Usage: file_times file" << endl; return 1; } QString filename = argv[1]; QFileInfo fileinfo{filename}; bool isDir = fileinfo.isDir(); QString boolText = isDir ? "true" : "false"; QString absPath = fileinfo.absoluteFilePath(); QString baseName = fileinfo.baseName(); QString compBaseName = fileinfo.completeBaseName(); QString fileName = fileinfo.fileName(); QString suffix = fileinfo.suffix(); QString compSuffix = fileinfo.completeSuffix(); out << "QT version: " << QT_VERSION_STR << endl; out << "Absolute file path: " << absPath << endl; out << "Base name: " << baseName << endl; out << "Complete base name: " << compBaseName << endl; out << "File name: " << fileName << endl; out << "Suffix: " << suffix << endl; out << "Whole suffix: " << compSuffix << endl; out << "isDir(): " << boolText << endl; return 0; }
Calling the program to check a file:
./file_path /usr/lib/libqwt-qt5.so.6
Gives the correct result:
QT version: 5.11.3
Absolute file path: /usr/lib/libqwt-qt5.so.6
Base name: libqwt-qt5
Complete base name: libqwt-qt5.so
File name: libqwt-qt5.so.6
Suffix: 6
Whole suffix: so.6
isDir(): false
Calling the program to check a dir:
./file_path /usr/lib/
Outputs a wrong result in the "isDir" property:
QT version: 5.11.3
Absolute file path: /usr/lib/
Base name:
Complete base name:
File name:
Suffix:
Whole suffix:
isDir(): false
The OS is in a Docker container.