Problems executing system
Hello , I am working with Qt in Linux and I would like to execute a comand and obtain the result of that comand and keep it in a String . I use the comand system but it returns 0 or 1 , but I am interested in obtaining the result of than comand.
For example
system("java -jar project.jar ")
I would like to obtain the result of executing "java -jar project.jar" and keep it in a QString, but I only obtain 0 or 1.
Thanks
Gorka
Re: Problems executing system
You can use QProcess, that system not portable.
LE: correction: Linux has a system, sorry for my wrong intervention.
Anyway you can give QProcess a try - it has more functionality (see the documentation link).
Re: Problems executing system
You can redirect stdout ( and stderr) to your file, then read the file content in QString