[Interest] QDir::entry(Info)List on macos
Manner Róbert
rmanni at gmail.com
Thu Nov 15 08:54:38 CET 2018
On 11/14/18 5:34 PM, Thiago Macieira wrote:
> On Wednesday, 14 November 2018 01:34:17 PST Manner Róbert wrote:
>> int main() {
>> qDebug() << QDir(".").entryList();
> QCoreApplication missing. Try again with it.
>
Tried, without success, still does not display these files. Even tried
with QDirIterator, that is also working the same (skipping these files).
With further checking I noticed that the files are only not displaying
if I do not create them with Qt. Eg I created with "touch filenamé". If
I create the same file with QFile, that seems to be found by these dir
lists. I know it sounds insane.
Locale is utf8:
> locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
The modified source code:
> cat main.cpp
#include <QDirIterator>
#include <QDebug>
#include <QFileInfoList>
#include <QCoreApplication>
#include <QFile>
int main(int argc, char** argv) {
QFile file("éáőú"); // This file is visible in the list! But not any
other I create with touch for example.
file.open(QFile::WriteOnly);
file.close();
QCoreApplication app(argc, argv);
QDirIterator iterator(".", QDir::Files, QDirIterator::Subdirectories);
while (iterator.hasNext())
{
qDebug() << "QDiriterator" << iterator.next();
}
qDebug() << QDir(".").entryList(QDir::System | QDir::AllEntries |
QDir::Hidden);
qDebug() << QDir(".").entryInfoList(QDir::System | QDir::AllEntries |
QDir::Hidden);
}
Thanks in advance for any idea.
Robert
More information about the Interest
mailing list