MCPcopy Index your code
hub / github.com/RustPython/RustPython / makefile

Method makefile

Lib/tarfile.py:2653–2667  ·  view source on GitHub ↗

Make a file called targetpath.

(self, tarinfo, targetpath)

Source from the content-addressed store, hash-verified

2651 raise
2652
2653 def makefile(self, tarinfo, targetpath):
2654 """Make a file called targetpath.
2655 """
2656 source = self.fileobj
2657 source.seek(tarinfo.offset_data)
2658 bufsize = self.copybufsize
2659 with bltn_open(targetpath, "wb") as target:
2660 if tarinfo.sparse is not None:
2661 for offset, size in tarinfo.sparse:
2662 target.seek(offset)
2663 copyfileobj(source, target, size, ReadError, bufsize)
2664 target.seek(tarinfo.size)
2665 target.truncate()
2666 else:
2667 copyfileobj(source, target, tarinfo.size, ReadError, bufsize)
2668
2669 def makeunknown(self, tarinfo, targetpath):
2670 """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