MCPcopy
hub / github.com/RUB-NDS/PRET / dir_exists

Method dir_exists

postscript.py:125–134  ·  view source on GitHub ↗
(self, path, list=[])

Source from the content-addressed store, hash-verified

123
124 # check if remote directory exists
125 def dir_exists(self, path, list=[]):
126 path = self.escape(path)
127 if self.fuzz and not list: # use status instead of filenameforall
128 return (self.file_exists(path) != c.NONEXISTENT)
129 # use filenameforall as some ps interpreters do not support status
130 if not list:
131 list = self.dirlist(path, False)
132 for name in list: # use dirlist to check if directory
133 if re.search("^(%.*%)?" + path + c.SEP, name):
134 return True
135
136 # check if remote file exists
137 def file_exists(self, path, ls=False):

Callers 1

do_lsMethod · 0.95

Calls 4

escapeMethod · 0.95
file_existsMethod · 0.95
dirlistMethod · 0.95
searchMethod · 0.80

Tested by

no test coverage detected