From: painulyarun@... Date: 2007-09-21T15:10:04+09:00 Subject: Re: Regarding _popen() in windows 2000 On Sep 15, 12:38 am, Daniel Berger wrote: > On Sep 14, 12:05 pm, painulya...@gmail.com wrote: > > > Hi All, > > > I have a console application. In windows 2000, _popen() is returning > > invalid handle. I checked the same app with 2003 Server, its working > > fine. > > Are you talking about IO.popen? I didn't think Ruby used _popen() > behind the scenes, but it's been a while since I looked. The _popen() > function is basically broken on Windows. From MSDN: > > "If used in a Windows program, the _popen function returns an invalid > file pointer that will cause the program to hang indefinitely. _popen > works properly in a Console application. To create a Windows > application that redirects input and output, see "Creating a Child > Process with Redirected Input and Output" in the Platform SDK." > > Regards, > > Dan Thanks a lot! The problem is resolved by setting /MD flag.