def makedev(self, cpioinfo, cpiogetpath):
"""Make a character or block device called cpiogetpath.
"""
if not hasattr(os, "mknod") or not hasattr(os, "makedev"):
raise ExtractError("special devices not supported by system")
mode = cpioinfo.mode
if cpioinfo.isblk():
mode |= stat.S_IFBLK
else:
mode |= stat.S_IFCHR
os.mknod(cpiogetpath, mode,
os.makedev(cpioinfo.devmajor, cpioinfo.devminor))
评论列表
文章目录