QProcess run a process and not a shell so the * wilcard does not work.
This will work, but it's ugly
process->start("sh -c \"ls /dev/tty*\"");
process->waitForFinished(-1);
qDebug() << process->readAllStandardOutput();
qDebug() << process->readAllStandardError();
QProcess* process = new QProcess();
QStringList sArgs;
process->start("sh -c \"ls /dev/tty*\"");
process->waitForFinished(-1);
qDebug() << process->readAllStandardOutput();
qDebug() << process->readAllStandardError();
To copy to clipboard, switch view to plain text mode
This is better :
qDebug
() << lsDev.
entryList(QDir::System);
QDir lsDev("/dev/");
lsDev.setNameFilters(QStringList() << "tty*");
qDebug() << lsDev.entryList(QDir::System);
To copy to clipboard, switch view to plain text mode
Bookmarks