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

Method makedev

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

Make a character or block device called targetpath.

(self, tarinfo, targetpath)

Source from the content-addressed store, hash-verified

2481 raise ExtractError("fifo not supported by system")
2482
2483 def makedev(self, tarinfo, targetpath):
2484 """Make a character or block device called targetpath.
2485 """
2486 if not hasattr(os, "mknod") or not hasattr(os, "makedev"):
2487 raise ExtractError("special devices not supported by system")
2488
2489 mode = tarinfo.mode
2490 if mode is None:
2491 # Use mknod's default
2492 mode = 0o600
2493 if tarinfo.isblk():
2494 mode |= stat.S_IFBLK
2495 else:
2496 mode |= stat.S_IFCHR
2497
2498 os.mknod(targetpath, mode,
2499 os.makedev(tarinfo.devmajor, tarinfo.devminor))
2500
2501 def makelink(self, tarinfo, targetpath):
2502 """Make a (symbolic) link called targetpath. If it cannot be created

Callers 1

_extract_memberMethod · 0.95

Calls 2

ExtractErrorClass · 0.85
isblkMethod · 0.80

Tested by

no test coverage detected