Whether this path is a directory.
(self, *, follow_symlinks=True)
| 669 | return True |
| 670 | |
| 671 | def is_dir(self, *, follow_symlinks=True): |
| 672 | """Whether this path is a directory.""" |
| 673 | if self._entry: |
| 674 | try: |
| 675 | return self._entry.is_dir(follow_symlinks=follow_symlinks) |
| 676 | except OSError: |
| 677 | return False |
| 678 | if follow_symlinks: |
| 679 | if self._stat_result is _STAT_RESULT_ERROR: |
| 680 | return False |
| 681 | else: |
| 682 | if self._lstat_result is _STAT_RESULT_ERROR: |
| 683 | return False |
| 684 | try: |
| 685 | st = self._stat(follow_symlinks=follow_symlinks) |
| 686 | except (OSError, ValueError): |
| 687 | return False |
| 688 | return S_ISDIR(st.st_mode) |
| 689 | |
| 690 | def is_file(self, *, follow_symlinks=True): |
| 691 | """Whether this path is a regular file.""" |