Forum: Ruby IO.write problem on "raw" Windows

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
0bdb9e1d8ea8709fd4c39322ae8301a3?d=identicon&s=25 unknown (Guest)
on 2007-06-28 14:46
(Received via mailing list)

I have a problem with the following code:

prg = "c:\\path\\to\\some\\program" # for cmd
# prg = "/cygdrive/c/path/to/some/program" # for cygwin
IO.popen(prg, "r+b") do |pipe| ARGV[0], 'rb' do |fin|

On Windows, when running "normal" ruby from a command prompt (Windows'
cmd.exe), it blocks on write. I can interrupt it using Ctrl+C, but it
never goes through. Doing all sorts of "debug" testing, I found out
that it always blocks on the same character if the input data is the
same. Different input data (i.e. different input files, whose
filenames are given on a command line) gives different results. I am
using ruby 1.8.6.

What is even more interesting is that on Cygwin this works. I have
ruby 1.8.5 there. Also, it is working on other machines. The "other"
program itself is working fine - it's a simple echo-clone. Do you have
any idea what might be causing this? I thought of a lot of good
reasons, but failed to find one that really is the one. At least, do
you have any suggestions of what I might try?
This topic is locked and can not be replied to.