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

Method makedev

Lib/tarfile.py:2685–2701  ·  view source on GitHub ↗

Make a character or block device called targetpath.

(self, tarinfo, targetpath)

Source from the content-addressed store, hash-verified

2683 raise ExtractError("fifo not supported by system")
2684
2685 def makedev(self, tarinfo, targetpath):
2686 """Make a character or block device called targetpath.
2687 """
2688 if not hasattr(os, "mknod") or not hasattr(os, "makedev"):
2689 raise ExtractError("special devices not supported by system")
2690
2691 mode = tarinfo.mode
2692 if mode is None:
2693 # Use mknod's default
2694 mode = 0o600
2695 if tarinfo.isblk():
2696 mode |= stat.S_IFBLK
2697 else:
2698 mode |= stat.S_IFCHR
2699
2700 os.mknod(targetpath, mode,
2701 os.makedev(tarinfo.devmajor, tarinfo.devminor))
2702
2703 def makelink(self, tarinfo, targetpath):
2704 return self.makelink_with_filter(tarinfo, targetpath, None, None)

Callers 2

_extract_memberMethod · 0.95
test_makedevMethod · 0.80

Calls 4

hasattrFunction · 0.85
ExtractErrorClass · 0.85
isblkMethod · 0.80
mknodMethod · 0.80

Tested by 1

test_makedevMethod · 0.64