MCPcopy Index your code
hub / github.com/fluentpython/example-code-2e / _copy_file

Method _copy_file

21-async/mojifinder/bottle.py:2389–2395  ·  view source on GitHub ↗
(self, fp, chunk_size=2**16)

Source from the content-addressed store, hash-verified

2387 return fname[:255] or 'empty'
2388
2389 def _copy_file(self, fp, chunk_size=2**16):
2390 read, write, offset = self.file.read, fp.write, self.file.tell()
2391 while 1:
2392 buf = read(chunk_size)
2393 if not buf: break
2394 write(buf)
2395 self.file.seek(offset)
2396
2397 def save(self, destination, overwrite=False, chunk_size=2**16):
2398 ''' Save file to disk or copy its content to an open file(-like) object.

Callers 1

saveMethod · 0.95

Calls 1

readFunction · 0.85

Tested by

no test coverage detected