From: Joel VanderWerf Date: 2005-09-20T02:00:23+09:00 Subject: Re: Handling multiple processes on Windows 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 -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407