| 161 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| 162 | # get complete list of files and directories on remote device |
| 163 | def dirlist(self, path="", r=True): |
| 164 | if r: |
| 165 | path = self.rpath(path) |
| 166 | path = self.escape(path + self.get_sep(path)) |
| 167 | vol = "" if self.vol else "%*%" # search any volume if none specified |
| 168 | # also lists hidden .dotfiles + special treatment for brother devices |
| 169 | str_recv = self.find(vol + path + "**") or self.find(vol + path + "*") |
| 170 | list = {name for name in str_recv.splitlines()} |
| 171 | return sorted(list) |
| 172 | |
| 173 | def find(self, path): |
| 174 | str_send = '{false statusdict /setfilenameextend get exec} stopped\n'\ |