system() call external command, and get command resuld
hi everyone,
in my program, i need to call an external command ("dmtxread") to decode a 2D barcode. and display the result.
i can achieve above what i need by using system()
Code:
system("dmtxread /home/cz/Webcam/abc.jpg >> /home/cz/Webcam/a.txt");
as you can see, i sent result into a text file (a.txt). after that, i used QFile read the content of a.txt as a string. then, display this string.
i am just wondering is there any other way i can save the result to a buffer, or a string, directly, instead of creating a file to store the result, and read the content out.
can anyone give me a hint or suggestion, please?
thank in advance.
Re: system() call external command, and get command resuld
use QProcess and read the standard output into the string.
Re: system() call external command, and get command resuld
why you double post? there is no need for it. Already answered in newbie post.
Re: system() call external command, and get command resuld
Quote:
Originally Posted by
MrDeath
why you double post? there is no need for it. Already answered in newbie post.
thanks Mr death, i just want to make sure someone will read my post :o
thanks for your reply. i will take a look QProcess
Re: system() call external command, and get command resuld
dont worry.. a single topic will attract more ppl. And will have much more discussion. So never duplicate your topic.