class_docstr: This filesystem enables to easily move files from and to the shared storage.
class_docstr_tok: ["This","filesystem","enables","to","easily","move","files","from","and","to","the","shared","storage","."]
docstr: This method enables to list files from the shared storage in a blocking fashion.
  
  Arguments:
      path: The path to files to list.
docstr_tok: ["This","method","enables","to","list","files","from","the","shared","storage","in","a","blocking","fashion",".","Arguments",":","path",":","The","path","to","files","to","list","."]
code: def walk(self, path: str) -> List[str]:
      """This method enables to list files from the shared storage in a blocking fashion.
  
      Arguments:
          path: The path to files to list.
  
      """
      if not path.startswith("/"):
          raise Exception(
              f"The provided destination {path} needs to start with `/`."
          )
  
      shared_path = Path(os.path.join(self._root, path[1:])).resolve()
  
      if not self._fs.exists(shared_path):
          raise RuntimeError(
              f"The provided path {shared_path} doesn't exist."
          )
  
      # Invalidate cache before running ls in case new directories have been added
      # TODO: Re-evaluate this - may lead to performance issues
      self._fs.invalidate_cache()
  
      paths = self._fs.ls(shared_path)
      if not paths:
          return paths
  
      out = []
  
      for shared_path in paths:
          path = str(shared_path).replace(self._root, "")
          if self._fs.isdir(shared_path):
              out.extend(self.walk(path))
          else:
              if path.endswith("info.txt"):
                  continue
              out.append(path[1:])
      return sorted(out)
  
file_path: pytorch-lightning/src/lightning/app/storage/filesystem.py
imports: import os
  import shutil
  from pathlib import Path
  from typing import Callable, List
  from fsspec.implementations.local import LocalFileSystem
  from lightning.app.storage.copier import _copy_files
  from lightning.app.storage.path import _filesystem, _shared_storage_path
label_desc: Use image node_id 5 for calling the FileSystem obj's underlying member method code with example usage: obj.walk(path) and returns: sorted, paths