From: Andrew Stewart Date: 2006-11-09T03:36:58+09:00 Subject: Re: Net::SSH Data Stream Problem On 8 Nov 2006, at 18:19, ara.t.howard@noaa.gov wrote: > does this help? > >> def copy_file(session, source_path, destination_path=nil) >> destination_path ||= source_path >> cmd = %{cat > "#{destination_path.gsub('"', '\"')}"} >> session.process.popen3 cmd do |stdin, stdout, stderr| >> print "Copying #{source_path} to #{destination_path}..." >> open(source_path) { |f| stdin.write f.read } > stdin.flush > stdin.close_write > stdout.read > stderr.read > >> puts "done." >> end >> end It gives me an undefined method error for flush: undefined method `flush' for # (NoMethodError) from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-1.0.9/lib/net/ ssh/service/process/popen3.rb:52:in `popen3' Regards, Andy