From: Fengfeng Li Date: 2012-03-28T23:52:38+09:00 Subject: How to process telnet data(binary) Hi everyone, I'm using Net::telnet(windows) to get files from a linux system: data = socket.cmd("gzip -c xxx") f = File.open("abc.gz", "wb") f.write data f.close system('winrar ... abc') but this code works only for some files, other file reported an CRC error when being unzipped. To solve the problem, I type "gzip -c xxx >abc1.gz" and download abc1.gz through ftp(binary mode) and compare it with abc.gz, and found they actually have differences, some bytes are not the same. I guess it's because the telnet protocol transfer some bytes before send it to me? Please help me to work it out, Thanks a lot:) -- Posted via http://www.ruby-forum.com/.