method
transfercmd
transfercmd(cmd, rest_offset = nil)
private
Hide source
# File lib/net/ftp.rb, line 329 def transfercmd(cmd, rest_offset = nil) if @passive host, port = makepasv conn = open_socket(host, port) if @resume and rest_offset resp = sendcmd("REST " + rest_offset.to_s) if resp[0] != 33 raise FTPReplyError, resp end end resp = sendcmd(cmd) # skip 2XX for some ftp servers resp = getresp if resp[0] == 22 if resp[0] != 11 raise FTPReplyError, resp end else sock = makeport if @resume and rest_offset resp = sendcmd("REST " + rest_offset.to_s) if resp[0] != 33 raise FTPReplyError, resp end end resp = sendcmd(cmd) # skip 2XX for some ftp servers resp = getresp if resp[0] == 22 if resp[0] != 11 raise FTPReplyError, resp end conn = sock.accept sock.close end return conn end