From: "Ara.T.Howard" Date: 2005-09-20T02:14:10+09:00 Subject: Re: Handling multiple processes on Windows On Tue, 20 Sep 2005, Joel VanderWerf wrote: > Gregory Brown wrote: > >> So my question is, how exactly would you go about writing a program >> that could fire a process to a command line application, let it run, >> give control back to your main program, and kill the process if an >> event occurs (Like the pressing of a 'stop' button or even command line >> interaction). >> >> I thought about threading but since the threads are done in process I'm >> afraid of explosions and complications galore. > > Use a ruby thread to manage the external process. There are some libs > for this (session is one, I think it will give you better access to > in/out/err streams). But ruby itself has some basic support: > > cmd_th = Thread.new do > system "something" > end > > if user_presses_stop > cmd_th.kill > end session could be ported to windows using the win32-popen3 call. volunteers? -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | Your life dwells amoung the causes of death | Like a lamp standing in a strong breeze. --Nagarjuna ===============================================================================