Reputation: 66
Is it possible to write directly to stdout of another process?
We have two separated processes A and B. Process B should write to its stdout information from process A. I was looking into that and found the pipes... but the problem is that i don't really like the need to write from A and read from B at the same time (amount of information can be very big and pipes by itself are limited by system?) mostly because it can be too complex. And maybe it could be easier to write into file from A and then print this file into stdout from B...
UPDATE: Process A is expected to be running constantly starting from system start-up(Unix) Process B is expected to be executed from console and get information from process A. Communication between processes are easy to implement in our environment. But since amount of information can be very big i wanted to make high-efficient way to get infromation from A to stdout of B
Upvotes: 1
Views: 1082
Reputation: 7717
You may send STDOUT
file descriptor (1
) from B to A over UNIX domain socket connection.
You can do it manually. Or you can use portable library.
In either case process A will receive file STDOUT
descriptor of B. Then A can write()
to it.
Upvotes: 2