Whether this path is a regular file (also True for symlinks pointing to regular files).
(self)
| 1570 | return False |
| 1571 | |
| 1572 | def is_file(self): |
| 1573 | """ |
| 1574 | Whether this path is a regular file (also True for symlinks pointing |
| 1575 | to regular files). |
| 1576 | """ |
| 1577 | try: |
| 1578 | return S_ISREG(self.stat().st_mode) |
| 1579 | except OSError as e: |
| 1580 | if e.errno not in (ENOENT, ENOTDIR): |
| 1581 | raise |
| 1582 | # Path doesn't exist or is a broken symlink |
| 1583 | # (see https://bitbucket.org/pitrou/pathlib/issue/12/) |
| 1584 | return False |
| 1585 | |
| 1586 | def is_symlink(self): |
| 1587 | """ |