Open diondokter opened 2 months ago
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 ofstd::io::{Read, Write, Seek}
backed by stable memory to enable the use of existing Rust code that requires implementations of these traits.icfs-fatfs
usesicfs
to leverage thefatfs
crate in providing a FAT file system. All this currently does is implement afatfs::TimeProvider
backed byic_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 https://github.com/rust-lang/libs-team/issues/293 got some traction, that would be a nice approach.
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!