(path)
| 69 | |
| 70 | |
| 71 | def _regular(path): |
| 72 | parent, name = os.path.split(os.path.abspath(path)) |
| 73 | directory = _directory(parent) |
| 74 | try: |
| 75 | fd = os.open(name, os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, |
| 76 | dir_fd=directory) |
| 77 | finally: |
| 78 | os.close(directory) |
| 79 | if not stat.S_ISREG(os.fstat(fd).st_mode): |
| 80 | os.close(fd) |
| 81 | _error("input", "input is not a regular file") |
| 82 | return fd |
| 83 | |
| 84 | |
| 85 | def _signature(info): |