Logo Search packages:      
Sourcecode: s3ql version File versions  Download package

def s3ql::backends::ftplib::FTP::retrbinary (   self,
  cmd,
  callback,
  blocksize = 8192,
  rest = None 
)
Retrieve data in binary mode.  A new port is created for you.

Args:
  cmd: A RETR command.
  callback: A single parameter callable to be called on each
    block of data read.
  blocksize: The maximum number of bytes to read from the
     socket at one time.  [default: 8192]
  rest: Passed to transfercmd().  [default: None]

Returns:
  The response code.

Reimplemented in s3ql::backends::ftplib::FTP_TLS.

Definition at line 387 of file ftplib.py.

                                                                  :
        """Retrieve data in binary mode.  A new port is created for you.

        Args:
          cmd: A RETR command.
          callback: A single parameter callable to be called on each
                    block of data read.
          blocksize: The maximum number of bytes to read from the
                     socket at one time.  [default: 8192]
          rest: Passed to transfercmd().  [default: None]

        Returns:
          The response code.
        """
        self.voidcmd('TYPE I')
        conn = self.transfercmd(cmd, rest)
        while 1:
            data = conn.recv(blocksize)
            if not data:
                break
            callback(data)
        conn.close()
        return self.voidresp()


Generated by  Doxygen 1.6.0   Back to index