Whether this path exists.
(self, *, follow_symlinks=True)
| 652 | return self._lstat_result |
| 653 | |
| 654 | def exists(self, *, follow_symlinks=True): |
| 655 | """Whether this path exists.""" |
| 656 | if self._entry: |
| 657 | if not follow_symlinks: |
| 658 | return True |
| 659 | if follow_symlinks: |
| 660 | if self._stat_result is _STAT_RESULT_ERROR: |
| 661 | return False |
| 662 | else: |
| 663 | if self._lstat_result is _STAT_RESULT_ERROR: |
| 664 | return False |
| 665 | try: |
| 666 | self._stat(follow_symlinks=follow_symlinks) |
| 667 | except (OSError, ValueError): |
| 668 | return False |
| 669 | return True |
| 670 | |
| 671 | def is_dir(self, *, follow_symlinks=True): |
| 672 | """Whether this path is a directory.""" |