From: Brian Candler Date: 2009-04-15T22:01:21+09:00 Subject: Re: using popen Jun Young Kim wrote: > ---------------------------------------------------------- > require 'open3' > include Open3 > > stdin, stdout, stderr = popen3("ftp ftp.gnu.org") > > puts stdout.sysread(1024) > ---------------------------------------------------------- > > looks like a hang. > > Could you tell me why this thing is happened? Probably because (a) the ftp client is waiting for data from the terminal before it has sent 1024 bytes of reply, and/or (b) the ftp client expects to be run on an interactive tty. If (b) applies, look at using require 'pty' But for FTP, you are almost certainly better off using Net::FTP from the Ruby standard library, rather than spawning an external ftp client. -- Posted via http://www.ruby-forum.com/.