The binary methods of ftplib have similar syntax:
-
x.storbinary(command, file[, blocksize) : used to store a file in binary mode.
x.retrbinary(command, callback[, blocksize[, rest) : used to retrieve a file in binary mode.
There are two significant points of difference between binary and text transactions. First, both binary commands allow for the optional blocksize argument. Where text transactions occur at a pre-set (and often slower) rate, binary mode is faster. By default, data is read in blocks of 8,192 bytes. However, if you know that the network will support it, you can change that when you invoke the binary method.
Second, binary retrieval supports the optional rest argument. This argument allows you to initiate downloads in the middle of a file. This function is not supported by all FTP servers. If the FTP server does not support it, an error_reply exception is raised.
