Return True if 'other' references the same file as 'self'.
(self, other)
| 583 | return os.fspath(self) > os.fspath(other) |
| 584 | |
| 585 | def samefile(self, other): |
| 586 | """Return True if 'other' references the same file as 'self'.""" |
| 587 | other = os.fspath(other) |
| 588 | if not isabs(other): |
| 589 | other = abspath(other) |
| 590 | if self == other: |
| 591 | return True |
| 592 | if not hasattr(os.path, "samefile"): |
| 593 | return False |
| 594 | return error.checked_call(os.path.samefile, self.strpath, other) |
| 595 | |
| 596 | def remove(self, rec=1, ignore_errors=False): |
| 597 | """Remove a file or directory (or a directory tree if rec=1). |