Make a character or block device called targetpath.
(self, tarinfo, targetpath)
| 2702 | raise ExtractError("fifo not supported by system") |
| 2703 | |
| 2704 | def makedev(self, tarinfo, targetpath): |
| 2705 | """Make a character or block device called targetpath. |
| 2706 | """ |
| 2707 | if not hasattr(os, "mknod") or not hasattr(os, "makedev"): |
| 2708 | raise ExtractError("special devices not supported by system") |
| 2709 | |
| 2710 | mode = tarinfo.mode |
| 2711 | if mode is None: |
| 2712 | # Use mknod's default |
| 2713 | mode = 0o600 |
| 2714 | if tarinfo.isblk(): |
| 2715 | mode |= stat.S_IFBLK |
| 2716 | else: |
| 2717 | mode |= stat.S_IFCHR |
| 2718 | |
| 2719 | os.mknod(targetpath, mode, |
| 2720 | os.makedev(tarinfo.devmajor, tarinfo.devminor)) |
| 2721 | |
| 2722 | def makelink(self, tarinfo, targetpath): |
| 2723 | return self.makelink_with_filter(tarinfo, targetpath, None, None) |