Brian Candler wrote in post #1053836: > Have you tried setting Binmode option to Net::Telnet? > > # Binmode:: if false (the default), newline substitution is > performed. > # Outgoing LF is > # converted to CRLF, and incoming CRLF is converted to LF. > If > # true, this substitution is not performed. This value > can > # also be set with the #binmode() method. The > # outgoing conversion only applies to the #puts() and > #print() > # methods, not the #write() method. The precise nature of > # the newline conversion is also affected by the telnet > options > # SGA and BIN. > > However I would say that your proposed way of doing things is very > fragile, because if nothing else there will be trailing garbage (the > command prompt) added to your data. > > You might want to look at SCP or SFTP for a more robust way of copying > files from a Linux system. SCP seems only work between two linuxes, so I tried SFTP, it's really good. But some of my test machines(LINUX) don't provide SSH service, so I go back to the old way for them. How can I solve the problem? Tt really bothers me, I've tried for 2 days and cann't finger out how telnet transfer its data. Can anyone give me more clues? Thanks a lot. -- Posted via http://www.ruby-forum.com/.