QFileInfo::isExecutable() returns true for dirs
General and Desktop
4
Posts
2
Posters
1.8k
Views
1
Watching
-
I am using the following code to search all subdirs for executables.
@QDir dir(path);
QDirIterator iterator(dir.absolutePath(), QDirIterator::Subdirectories);
while (iterator.hasNext()) {
iterator.next();
if(!iterator.fileInfo().isDir() && iterator.fileInfo().isExecutable()) {
tests.append(new QFile(iterator.filePath()));
qDebug() << iterator.filePath();
emit locatedTest(iterator.fileName());
}
}@That works fine, however if i remove the isDir() check, all directories, including . and .., are printed aswell. Is this a bug, or is there some reason I don't understand?