Skip to content

Interest in Pathlib abstraction? #172

Description

@Krakonos

Hi!

I have implemented a wrapper around LittleFS object that provides pathlib abstraction, building on top of PurePosixPath. I can either publish it as a standalone package or make PR and make it part of the this repo. Currently, the idea is:

fs = LittleFS(...)
root_path = littlefs_pathlib.from_lfs(fs)
for file in root_path.glob("**"):
  print(file)

If we build it into this package, I would suggest changing this to fs.get_path("/") or similar, but I would keep it separate and not change the LittleFS object. Alternatively, we could do LittleFSPath object that is constructed with the same arguments as LittleFS, provides access to the lower object.

Right now it's about 250 lines of python + tests, so not much of a maintenance burden, especially since it builds strictly on top of the LittleFS object so it doesn't need to handle all the low level parameters.``

Thoughts? @jrast

Note: I'm not pushing this, so if you feel it's out of the scope, feel free to say no, I my self can't decide what would be better, so I decided to get a second opinion here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions