From: Brian Candler Date: 2008-11-26T23:14:09+09:00 Subject: Re: multiplatform pipe open? Sebastian (syepes) wrote: > Hi all, > > I'm starting with Ruby and i am trying to migrate some Perl scripts to > Ruby, but cant get pipes with open to work like in perl. > > What's the Right way to make open "pipes, stdin,stdout" work in all OS > platforms, with no external gems? > > I have tried the 'fh = IO.popen("/bin/console_programe","w+")', but > don't understand why i need to use the method "close_write". You don't show your Ruby code, but maybe you just need fh.flush after the last write, or set fh.sync = true after opening the pipe. That is: the output data may be being buffered at the Ruby side. A close_write would certainly flush it, whilst allowing you to read the response. -- Posted via http://www.ruby-forum.com/.