def print_file(self, output, path, recursive):
node = self.vfs.open(path)
if self.vfs.is_internal_link(node):
self.print_internal_link(output, path, node)
elif self.vfs.is_regular(node):
self.print_regular(output, path)
elif self.vfs.is_directory(node):
self.print_directory(output, path)
for child_name, child_node in node.list():
child_path = pathlib.PurePosixPath(path) / child_name
child_path = child_path.as_posix()
if not recursive and self.vfs.is_directory(child_node):
self.print_directory(output, child_path)
else:
self.print_file(output, child_path, recursive)
else:
assert False, '?????????'
评论列表
文章目录