pathlib-abc icon indicating copy to clipboard operation
pathlib-abc copied to clipboard

Better support for flat namespaces

Open barneygale opened this issue 1 year ago • 0 comments

Some file formats and backends, like .tar files, Git, or Google Cloud Storage, store objects in a flat namespace rather than a tree of directory/file entries. These systems:

  • Do not require directory entries (e.g. .tar), and may not support them (e.g. Git, GCS)
  • Natively support enumeration of all files (perhaps under a certain prefix)
  • Require us to filter the list of all objects in order to implement iterdir()

We could provide a version of PathBase that adds an abstract itertree() method and implements iterdir(), glob() and rglob() by immediately calling itertree() and filtering results.

barneygale avatar Jan 20 '24 23:01 barneygale