Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: filesystem-like API on top of sequential-storage #54

Open
diondokter opened this issue May 7, 2024 · 1 comment
Open

Idea: filesystem-like API on top of sequential-storage #54

diondokter opened this issue May 7, 2024 · 1 comment

Comments

@diondokter
Copy link
Collaborator

I think a nice filesystem api could be built on top of the existing map.

It would have APIs for creating and deleting files. A file would then have APIs for for reading, writing and seeking.
It would be challenging to create, but it should be possible.

Obviously it wouldn't really be compatible with anything. But it'd save on using e.g. littlefs2.

If you've got interest in this or have ideas, then make sure to post here!

@paulyoung
Copy link

I don’t know much about this project but I saw your post on Mastodon and thought you might be interested in the approach I took in https://github.com/codebase-labs/icfs

  • icfs provides implementations of std::io::{Read, Write, Seek} backed by stable memory to enable the use of existing Rust code that requires implementations of these traits.
  • icfs-fatfs uses icfs to leverage the fatfs crate in providing a FAT file system. All this currently does is implement a fatfs::TimeProvider backed by ic_cdk::api::time()

Basically, by only implementing a few traits I was able to leverage some existing crates that had already done most of the work.

I provided a Unix-style API and had plans to work on one similar to std::fs so that it felt familiar.

Perhaps if rust-lang/libs-team#293 got some traction, that would be a nice approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants