Changeset 1621:60662e7b943d


Ignore:
Timestamp:
Dec 23, 2015, 6:29:53 PM (5 years ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Document `FTPHost.open` `rest` argument
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/ftputil.txt

    r1614 r1621  
    11331133
    11341134- ``FTPHost.open(path, mode="r", buffering=None, encoding=None,
    1135   errors=None, newline=None)``
     1135  errors=None, newline=None, rest=None)``
    11361136
    11371137  returns a file-like object that refers to the path on the remote
     
    11601160  in `io.open`_. The argument ``buffering`` currently is ignored.
    11611161  It's only there for compatibility with the ``io.open`` interface.
     1162
     1163  If the file is opened in binary mode, you may pass 0 or a positive
     1164  integer for the ``rest`` argument. The argument is passed to the
     1165  underlying FTP session instance (for example an instance of
     1166  ``ftplib.FTP``) to start reading or writing at the given byte
     1167  offset. For example, if a remote file contains the letters
     1168  "abcdef" in ASCII encoding, ``rest=3`` will start reading at "d".
     1169
     1170  .. warning::
     1171
     1172     If you pass ``rest`` values which point *after* the file, the
     1173     behavior is undefined and may even differ from one FTP servers to
     1174     another. Therefore, use the ``rest`` argument only for error
     1175     recovery in case of interrupted transfers. You need to keep track
     1176     of the transferred data so that you can provide a valid ``rest``
     1177     argument for a resumed transfer.
    11621178
    11631179.. _`io.open`: http://docs.python.org/library/io.html#io.open
Note: See TracChangeset for help on using the changeset viewer.