Returns True if the path exists and is a directory Example: >>> f = SSHPath('is_dir', ssh=ssh_conn) >>> f.is_dir() False >>> f.touch() >>> f.is_dir() False >>> f.unlink() >>> f.mkdir()
(self)
| 701 | return False |
| 702 | |
| 703 | def is_dir(self): |
| 704 | """Returns True if the path exists and is a directory |
| 705 | |
| 706 | Example: |
| 707 | |
| 708 | >>> f = SSHPath('is_dir', ssh=ssh_conn) |
| 709 | >>> f.is_dir() |
| 710 | False |
| 711 | >>> f.touch() |
| 712 | >>> f.is_dir() |
| 713 | False |
| 714 | >>> f.unlink() |
| 715 | >>> f.mkdir() |
| 716 | >>> f.is_dir() |
| 717 | True |
| 718 | """ |
| 719 | if not self.exists(): |
| 720 | return False |
| 721 | |
| 722 | if self.stat().st_mode & 0o040000: |
| 723 | return True |
| 724 | |
| 725 | return False |
| 726 | |
| 727 | def is_file(self): |
| 728 | """Returns True if the path exists and is a file |
no test coverage detected