ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Can someone point me to an article/HowTo on running a console based program from a KDevelop Qt app and how to parse the output of that console program.
All of those functions are designed for only read or write from what I understand. I need to execute a program and read the output of that program so that i can parse it. At the same time i need to issue commands to that program.
All of those functions are designed for only read or write from what I understand. I need to execute a program and read the output of that program so that i can parse it.
popen executes a program and gives you a pipe which you can use to write to its standard input and read from its standard output (if you pass "r+" as the second argument), which presumably would allow you to issue commands and parse the output of the program (although as acid says, this could be nasty in C).
popen would exist in Mac OSX, I doubt it would in the earlier (non-UNIX) versions. You might find Qt/KDE has some classes/functions which let you do the same kind of thing as popen.
Alex
Last edited by llama_meme; 02-25-2003 at 07:03 AM.
I'm using Qt/KDE for this project. I will look to see if there are any existing classes/functions to do this. Otherwise i will have to reread the popen documentation.
I have been reading a lot and found a couple of other possibilities, has anyone heard of Pstreams or Dynac++?
"In the simplest case, a PStreams class is like a C++ wrapper for the POSIX.2 functions popen(3) and pclose(3), using C++ IOStreams instead of C's stdio library." http://pstreams.sourceforge.net/
I'm new to programming under Linux and KDeveloper.
I hope someone can help me.
I have tried to add the kprocess.h header to a project in KDeveloper 2.1.5, but KDeveloper can not find the it. I have tried to add the include path and running configure, but to no help.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.