MCPcopy
hub / github.com/Gallopsled/pwntools / exists

Method exists

pwnlib/filesystem/ssh.py:682–701  ·  view source on GitHub ↗

Returns True if the path exists Example: >>> a = SSHPath('exists', ssh=ssh_conn) >>> a.exists() False >>> a.touch() >>> a.exists() True >>> a.unlink() >>> a.exists() False

(self)

Source from the content-addressed store, hash-verified

680 self.rename(target)
681
682 def exists(self):
683 """Returns True if the path exists
684
685 Example:
686
687 >>> a = SSHPath('exists', ssh=ssh_conn)
688 >>> a.exists()
689 False
690 >>> a.touch()
691 >>> a.exists()
692 True
693 >>> a.unlink()
694 >>> a.exists()
695 False
696 """
697 try:
698 self.stat()
699 return True
700 except IOError:
701 return False
702
703 def is_dir(self):
704 """Returns True if the path exists and is a directory

Callers 15

unlinkMethod · 0.95
rmdirMethod · 0.95
is_dirMethod · 0.95
is_fileMethod · 0.95
setup.pyFile · 0.80
_include_headerFunction · 0.80
asmFunction · 0.80
attachFunction · 0.80
corefileFunction · 0.80
cache_fileFunction · 0.80
provider_local_systemFunction · 0.80
_check_elf_cacheFunction · 0.80

Calls 1

statMethod · 0.95

Tested by

no test coverage detected