MCPcopy Create free account
hub / github.com/aws/aws-cli / provide_transfer_size

Method provide_transfer_size

awscli/s3transfer/upload.py:339–350  ·  view source on GitHub ↗
(self, transfer_future)

Source from the content-addressed store, hash-verified

337 return True
338
339 def provide_transfer_size(self, transfer_future):
340 fileobj = transfer_future.meta.call_args.fileobj
341 # To determine size, first determine the starting position
342 # Seek to the end and then find the difference in the length
343 # between the end and start positions.
344 start_position = fileobj.tell()
345 fileobj.seek(0, 2)
346 end_position = fileobj.tell()
347 fileobj.seek(start_position)
348 transfer_future.meta.provide_transfer_size(
349 end_position - start_position
350 )
351
352 def _get_upload_part_fileobj_with_full_size(self, fileobj, **kwargs):
353 # Note: It is unfortunate that in order to do a multithreaded

Callers

nothing calls this directly

Calls 3

tellMethod · 0.45
seekMethod · 0.45
provide_transfer_sizeMethod · 0.45

Tested by

no test coverage detected