MCPcopy Index your code
hub / github.com/python/cpython / _copy_from_file

Method _copy_from_file

Lib/pathlib/__init__.py:1334–1340  ·  view source on GitHub ↗
(self, source, preserve_metadata=False)

Source from the content-addressed store, hash-verified

1332 self._copy_from_file(source, preserve_metadata)
1333
1334 def _copy_from_file(self, source, preserve_metadata=False):
1335 ensure_different_files(source, self)
1336 with vfsopen(source, 'rb') as source_f:
1337 with open(self, 'wb') as target_f:
1338 copyfileobj(source_f, target_f)
1339 if preserve_metadata:
1340 _copy_info(source.info, self)
1341
1342 if copyfile2:
1343 # Use fast OS routine for local file copying where available.

Callers 1

_copy_fromMethod · 0.95

Calls 7

ensure_different_filesFunction · 0.90
vfsopenFunction · 0.90
copyfileobjFunction · 0.90
copyfile2Function · 0.90
_copy_infoFunction · 0.85
strFunction · 0.85
openFunction · 0.50

Tested by

no test coverage detected