From: Aaron Hinni Date: 2001-04-04T05:18:57+09:00 Subject: [ruby-talk:13467] RE: redirecting $stdin Sorry I don't have too many details for you here, but hopefully this will get you going in the right direction. If you want to write to stdin of your child process, I think you need to change the file descriptors around BEFORE you create the process. You basically have to set up an anonymous pipe and have the parent write to one end, and the child read from the other. Then set the STD_INPUT_HANDLE of the child to be equal to the pipe. Then create the process. Microsoft has some example C code on how to do this at: http://msdn.microsoft.com/library/psdk/winbase/prothred_4uus.htm But, to save you some time. Instead of sending a CTRL-C to stdin, I think it would be easier for you to send a CTRL-C signal to the process. You should be able to do this with the Process.kill method in Ruby. I have not tested this, but something like: Process.kill("SIGINT", child_pid ) should work... and is sooo much simpler. peace, aaron > I'm trying to be able to write to STDIN - yeah, its a strange > thing to do, > I know, but I've got to send a control-C to a child process > created with > Win32 CreateProcess calls and it seems like a good way to do it.