transfercmd(cmd, rest_offset = nil) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/net/ftp.rb, line 311
    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] != ?3
            raise FTPReplyError, resp
          end
        end
        resp = sendcmd(cmd)
        if resp[0] != ?1
          raise FTPReplyError, resp
        end
      else
        sock = makeport
        if @resume and rest_offset
          resp = sendcmd("REST " + rest_offset.to_s) 
          if resp[0] != ?3
            raise FTPReplyError, resp
          end
        end
        resp = sendcmd(cmd)
        if resp[0] != ?1
          raise FTPReplyError, resp
        end
        conn = sock.accept
        sock.close
      end
      return conn
    end
Register or log in to add new notes.