multipart_object_assembler.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:oci-python-sdk 作者: oracle 项目源码 文件源码
def add_parts_from_file(self, file_path):
        """
        Splits a file into parts and adds all parts to an internal list of parts to upload.  The parts will not be uploaded to the server until upload is called.

        :param string file_path: Path of file to upload in parts
        """
        with io.open(file_path, mode='rb') as file_object:
            file_object.seek(0, io.SEEK_END)
            end = file_object.tell()
            file_object.seek(0, io.SEEK_SET)
            offset = 0
            while file_object.tell() < end:
                self.add_part_from_file(file_path, offset=offset, size=self.part_size)
                offset += self.part_size
                file_object.seek(offset, io.SEEK_SET)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号