[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Starting and stopping a child process in Windows

Berger, Daniel

4/27/2005 2:54:00 PM

> -----Original Message-----
> From: nobu.nokada@softhome.net [mailto:nobu.nokada@softhome.net]
> Sent: Wednesday, April 27, 2005 8:47 AM
> To: ruby-talk ML
> Subject: Re: Starting and stopping a child process in Windows
>
>
> Hi,
>
> At Wed, 27 Apr 2005 11:46:11 +0900,
> Alexey Verkhovsky wrote in [ruby-talk:139984]:
> > What is the best / most reliable / most obvious way to
> start and kill
> > a child process under Windows? This child process happens to be a
> > Webrick application, and I don't care about being
> platform-dependent
> > in this case.
>
> With 1.9 feature:
>
> $ ruby -v -e 'pid = spawn("cmd.exe"); sleep 3;
> Process.kill("TERM", pid); puts; p Process.waitpid(pid); p $?'
> ruby 1.9.0 (2005-04-22) [i386-cygwin]
> Microsoft Windows 2000 [Version 5.00.2195]
> (C) Copyright 1985-2000 Microsoft Corp.
>
> c:\ruby>
> 2140
> #<Process::Status: pid=2140,signaled(SIGTERM=15)>

Which of the many flavors of spawn are you using on Win32? And how does
it work on Unix?

Regards,

Dan



1 Answer

nobu.nokada

4/27/2005 2:59:00 PM

0

Hi,

At Wed, 27 Apr 2005 23:53:52 +0900,
Berger, Daniel wrote in [ruby-talk:140048]:
> > With 1.9 feature:
> >
> > $ ruby -v -e 'pid = spawn("cmd.exe"); sleep 3;
> > Process.kill("TERM", pid); puts; p Process.waitpid(pid); p $?'
> > ruby 1.9.0 (2005-04-22) [i386-cygwin]
> > Microsoft Windows 2000 [Version 5.00.2195]
> > (C) Copyright 1985-2000 Microsoft Corp.
> >
> > c:\ruby>
> > 2140
> > #<Process::Status: pid=2140,signaled(SIGTERM=15)>
>
> Which of the many flavors of spawn are you using on Win32? And how does
> it work on Unix?

Which? I just use built-in method, and it works on other
platforms almost too, except for DJGPP and a few.

--
Nobu Nakada