From: Joel VanderWerf Date: 2004-05-14T05:51:45+09:00 Subject: Re: popen3 on windows Park Heesob wrote: > Hi, > > >> >>What's the status of popen3 on windows? >> >>I tried using win32_popen (from RAA) today with the 1.8.1-13 installer, >>but it breaks when I try to read from or write to the IO objects. >> >>Does anyone have a good alternative that works on windows? I need to >>control an ssh subprocess. >> >> > > The Ruby 1.8.1-13 installer was compiled with MS VC++ 7.x. > But the library win32_popen.so was compiled with MS VC++ 6.x. Good to know that. I've downloaded the free compiler tools from MS so I can build extensions to work with 1.8.1-13. > I uploaded http://home.nownuri.net/~phasis/popen/win32_popen_1.8.1.zip > It includes win32_popen.so comiled with MS VC++7.x. I'm puzzlied, why does VC generate a .so instead of a .dll? Oh well, ruby seems to load it with no problem. More significantly, I'm having trouble reading from a pipe: C:\win32_popen_1.8.1>irb -r win32_popen irb(main):001:0> pin, pout, perr = IO.win32_popen3("dir") => [#, #, #] irb(main):002:0> pout.read Errno::EBADF: Bad file descriptor from (irb):2:in `read' from (irb):2 The equivalent works with Open3.popen3 on linux. Am I doing something wrong?