MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / makefile

Method makefile

tools/python-3.11.9-amd64/Lib/tarfile.py:2451–2465  ·  view source on GitHub ↗

Make a file called targetpath.

(self, tarinfo, targetpath)

Source from the content-addressed store, hash-verified

2449 raise
2450
2451 def makefile(self, tarinfo, targetpath):
2452 """Make a file called targetpath.
2453 """
2454 source = self.fileobj
2455 source.seek(tarinfo.offset_data)
2456 bufsize = self.copybufsize
2457 with bltn_open(targetpath, "wb") as target:
2458 if tarinfo.sparse is not None:
2459 for offset, size in tarinfo.sparse:
2460 target.seek(offset)
2461 copyfileobj(source, target, size, ReadError, bufsize)
2462 target.seek(tarinfo.size)
2463 target.truncate()
2464 else:
2465 copyfileobj(source, target, tarinfo.size, ReadError, bufsize)
2466
2467 def makeunknown(self, tarinfo, targetpath):
2468 """Make a file from a TarInfo object with an unknown type

Callers 2

_extract_memberMethod · 0.95
makeunknownMethod · 0.95

Calls 3

copyfileobjFunction · 0.70
seekMethod · 0.45
truncateMethod · 0.45

Tested by

no test coverage detected