def METHOD_NAME(self, path: str, all: bool = False) -> None:
    try:
        if self.protocol.fs.isdir(path) and not self.showDirectories:
            files = self.protocol.fs.get_path(path)[:]
            if self.showHidden:
                dot = self.protocol.fs.getfile(path)[:]
                dot[A_NAME] = "."
                files.append(dot)
                # FIXME: should grab dotdot off the parent instead
                dotdot = self.protocol.fs.getfile(path)[:]
                dotdot[A_NAME] = ".."
                files.append(dotdot)
            else:
                files = [x for x in files if not x[A_NAME].startswith(".")]
            files.sort()
        else:
            files = (self.protocol.fs.getfile(path)[:],)
    except Exception:
        self.write(f"ls: cannot access {path}: No such file or directory\n")
        return
    filenames = [x[A_NAME] for x in files]
    if not filenames:
        return
    for filename in filenames:
        if all:
            isdir = self.protocol.fs.isdir(os.path.join(path, filename))
            if isdir:
                filename = f"4       ./{filename}\n"
                self.write(filename)
        else:
            filename = f"4       {filename}\n"
            self.write(filename)
    if all:
        self.write("36      .\n")