both attributes are present, they should
        refer to the same file.

        :param offset: position in the file to start reading from.
        :param str data: data to write into the file.
        :return: an SFTP error code like ``SFTP_OK``.
        r