Make a character or block device called targetpath.
(self, tarinfo, targetpath)
| 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) |