Whether this path is a directory.
(self)
| 1557 | return True |
| 1558 | |
| 1559 | def is_dir(self): |
| 1560 | """ |
| 1561 | Whether this path is a directory. |
| 1562 | """ |
| 1563 | try: |
| 1564 | return S_ISDIR(self.stat().st_mode) |
| 1565 | except OSError as e: |
| 1566 | if e.errno not in (ENOENT, ENOTDIR): |
| 1567 | raise |
| 1568 | # Path doesn't exist or is a broken symlink |
| 1569 | # (see https://bitbucket.org/pitrou/pathlib/issue/12/) |
| 1570 | return False |
| 1571 | |
| 1572 | def is_file(self): |
| 1573 | """ |