Regarding _popen() in windows 2000

P

painulyarun

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.

Please suggest ....

Thanks !
 
D

Daniel Berger

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
 
P

painulyarun

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top