From: "Michael C. Libby" Date: 2005-01-14T12:13:44+09:00 Subject: Re: system? exec? fork? thread? Help managing external process On Fri, Jan 14, 2005 at 08:20:25AM +0900, McMahon, Chris wrote: > > Hello... > I'm new to Ruby and I need some help with managing an external > process. I'm on Windows, and I want to do something (overly simplified) > like this: > > File.new(file_to_be_handled_by_outside_process.txt) > system ("C:\\filewatcher.exe file_to_be_handled_by_outside_process.txt") > > > The foreign process started by system() never stops. I need to > return control to the Ruby script after the system() call so that I can > have the Ruby script generate information for the foreign process to > handle. > Any suggestions would be welcome... > -Chris > IO.popen perhaps? That would allow you to read or write directly to the external process. But in your case fork seems the more likely choice, especially if your external process may not finish before your Ruby script. Then you probably want to use fork with Process.detach I would think. -Michael