Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to implement Unix's piping command in C++?

Status
Not open for further replies.

tykt77

Programmer
Jul 8, 2003
1
US
Hi, I have two c/c++ programs running at the same time and program A needs to pass some data to program B to be processed and pass back to program A.

I could store the data into a file and have program B access it, but I am thinking of using the piping command in Unix to pass the data back and forth. This way I don't need to allocate disk space to hold the data plus it will be a lot faster. Can anyone tell me how I can accomplish that, comments or suggestions. thank you in advance.....
 
Let the provider write to stdout and the consumer read from stdin.



/Per
Nerdy signatures are as lame as the inconsistent stardates of STTNG.
 
You can use pipes or sockets - for that You must create server and client parts of the connection - there are a lot of samples of it. On Windows, You can use ReadProcessMemory() or WM_COPYDATA. Very crazy Programmers use CreateRemoteThread() or SetWindowsHookEx(), but then You will need to build a dll.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top