FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

C++ linux piping

 


Antoine_935
Hi all.

I have to get the output of a system command under linux.
How can I open a pipe with the output of this command writing to it ?

In fact, how can I get the output of this command, with C++ ?
Nyizsa
As you would do with any other commands.
Code:
cin >> input;

Then you can pipe the two commands together:
Code:
command | your-program
Antoine_935
well... the program i already running when I need this output.
Liu
Have some kind of infinite loop that is listening for command line inputs or system outputs then.
Nyizsa
Are you trying to get the state of a process, or something similar? What is the original command, and what does your program intend to do?
Antoine_935
This is FLOOD !

Read the question before posting stupid answers !
I got the solution: popen, like in PHP
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.