[Qt-interest] How to get per-process stats (on linux) - reading /proc

Gopalakrishna Bhat gopalakbhat at gmail.com
Thu Nov 4 10:39:02 CET 2010


Hi,


> You can use system("ps  -A -o your_format_you_want_data_in") and write it to
> a file using freopen() in C/C++ code.
> Rest depends on how much you are familiar with string manipulation ;)
>>
I also think ps command is a way to do it. Do not use system()
function. Use QProcess to run your command like

QProcess *determine=new QProcess();
determine->start("dpkg","-i");
determine->waitForFinished();

Once done you can read the standardOutput through readAllStandardOutput()

With regards,
Gopalakrishna
-- 
My blog http://gkbhat.blogspot.com




More information about the Qt-interest-old mailing list