def do_cd(self, line):
'''
Pseudo Command: cd
Description:
Change the psuedo current working directory
Note: The shell keeps a pseudo working directory
that allows the user to change directory without
changing the directory of the working process on sensor.
Args:
cd <Directory>
'''
self._needs_attached()
path = self._file_path_fixup(line)
path = ntpath.abspath(path)
type = self._stat(path)
if (type != "dir"):
print("Error: Path %s does not exist" % path)
return
else:
self.cwd = path
# cwd never has a trailing \
if self.cwd[-1:] == '\\':
self.cwd = self.cwd[:-1]
log.info("Changed directory to {0}".format(self.cwd))
评论列表
文章目录