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