From: ara howard Date: 2008-02-21T14:10:55+09:00 Subject: Re: Strange Windows warning with IO.popen: The process tried to write to a nonexistent pipe On Feb 19, 2008, at 6:56 PM, Daniel Berger wrote: > Luis Lavena wrote: >> On Feb 19, 8:02 pm, Daniel Berger wrote: >>> Hi all, >>> >>> Ruby 1.8.6 >>> Windows XP Pro >>> >>> I tried this standalone snippet: >>> >>> io = IO.popen('date /t') >>> >>> Running that with -w I get this warning: >>> >>> The process tried to write to a nonexistent pipe >>> >> I got the same without the -w option. >> This is related to the redirection of stdio and stdout and the >> premature termination of them (in the child process spawn by ruby). >> If you add a Kernel.gets() or anything that delays the script >> termiantion you wouldn't get the warning. > > So, how do we fix it Luis? > > Regards, > > Dan > > you just need to make sure ruby doesn't exit before the process is done at_exit{ Process.kill io.pid} or at_exit{ io.read } etc a @ http://codeforpeople.com/ -- it is not enough to be compassionate. you must act. h.h. the 14th dalai lama