Creating processes is just half the story.
What if you want to control the process once it’s running? What if you want to send it data? Or read its output? Interprocess communication lets processes work together to get the job done. We’ll show you how to multiply the power of your code by letting it talk to other programs on your system.
When you run programs from the command line, you can
redirect the Standard Output to a file using the
The Standard Output is one of the three default data streams. A data stream is exactly what it sounds like: a stream of data that goes into, or comes out of, a process. There are data streams for the Standard Input, Output, and Error, and there are also data streams for other things, like files or network connections. When you redirect the output of a process, you change where the data is sent. So, instead of the Standard Output sending data to the screen, you can make it send the data to a file.
Redirection is really useful on the command line, but is there a way of making a process redirect itself?
Every process will contain the program it’s running, as well as space for stack and heap data. But it will also need somewhere ...