From: "Simon Kröger" Date: 2005-09-10T05:18:46+09:00 Subject: Re: Problem with popen on windows stevetuckner wrote: > [...] > Below was my attempt to say, here is how you should fix this issue. And > then it didn't work. If I run it with ruby it works fine. When I run it > with rubyw, it just goes away when I click run. Any ideas anyone? The > system code and `` code is taken from the list a long time ago. > > Steve Tuckner > [...cool code...] From the msdn library: Note The _popen function returns an invalid file handle, if used in a Windows program, 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, read the section "Creating a Child Process with Redirected Input and Output" in the Win32 SDK. hmmm ... i will read through the mentioned section .... (it's not 100% clear to me if this means "don't start a windows program with popen" or "don't start any program from a windows program" - it would make kind of sense if redirecting stdin from a program without stdin would fail) btw: on my computers (XP-Home) nothing 'goes away' but the cmd.exe window flickers as if ruby's popen would be used - strange. From the msdn again: ..and asynchronously executes a spawned copy of the command processor.. this is the main problem i guess. cheers Simon