Merhabalar,
Aşağıdaki komut ile Rpi'nin seri kodunu almaya çalışıyorum.
cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2
Qt içinde ise;
QProcess process; process.start("cat", QStringList() <<"/proc/cpuinfo"<< "|" << "grep"<< "Serial"<< "|"<< "cut"<< "-d"<< "' '"<< "-f"<< "2"); process.waitForFinished(-1); // will wait forever until finished QString stdout = process.readAllStandardOutput(); QString stderr = process.readAllStandardError(); qDebug()<<stdout<< endl; qDebug()<<stderr<< endl;
gibi bir şey deneyeyim dedim ama sanırım ikinci bir komuta aktardığım için sıkıntı oluyor. Dosyayı açıp içinden de çekebilirim ama kolayı varken kasmayayım dedim...
Gelen hata:
"/bin/cat: invalid option -- 'd'\nTry '/bin/cat --help' for more information.\n"
-- Kolay gelsin, Mucip:)