From: Hugh Sasse Date: 2006-11-09T02:56:31+09:00 Subject: Re: Net::SSH Data Stream Problem On Thu, 9 Nov 2006, Andrew Stewart wrote: > > On 8 Nov 2006, at 17:39, Hugh Sasse wrote: > > > what platform(s)? > > Local: OS X > Remote: Linux > > > # I suspect this should be: > > open(source_path, 'rb') { |f| stdin.write f.read } > > # so that that ctrl-Z isn't treated as EOF, or something ghastly > > # of that sort. > > I tried that just now but sadly it didn't change the result. OK, given they're both unices, that figures... I'd then read and write in smaller chunks. I don't do enough deep networking to know what packet sizes are sensible, but... --------------------------------------------------------------- IO#write ios.write(string) => integer ------------------------------------------------------------------------ Writes the given string to _ios_. The stream must be opened for writing. If the argument is not a string, it will be converted to a string using +to_s+. Returns the number of bytes written. [...] ...probably a good idea to check the return value. And for f.read. > Andy > Hugh