From: Gary Wright Date: 2009-08-25T08:07:56+09:00 Subject: Re: Asynchronous process to process pipe IO On Aug 24, 2009, at 6:50 PM, Mike Barsalou wrote: > > Would Ruby's fork behave exactly like system here, or would it have a > third path? Likely fork wouldn't be an option for the OP because he > wants to process the output? fork and exec are the 'primitive' operations. system is basically implemented by forking and having the child process exec the new program while the parent waits for it to complete. System() is just a convenience method for this common pattern. Capturing the output of a program basically means using fork/exec along with rearranging the standout output of the exec'ed program. For simple cases this is handled by Ruby's backtick syntax: output = `program_to_run` Gary Wright