rust3ds / ctru-rs

Rust wrapper for libctru
https://rust3ds.github.io/ctru-rs/
Other
120 stars 18 forks source link

Removal of all FS code and member renaming #150

Closed Meziu closed 9 months ago

Meziu commented 9 months ago

Inspired by this comment.

The fs service module is the only piece of this repo that hasn't received any form of update since the evolution from the old implementation.

Much of the reason why I decided to change the approach on the Rust3DS toolchain was to align as much as possible with the official Rust APIs and guidelines, so that we could embrace as much of the public ecosystem as possible. However, the fs module has for long been left behind as it wasn't really a priority (thanks to the already existing compatibility with C files for the SD card and ROMFS) and as such received no real improvements or testing.

What I removed in this PR was the original re-write of the std::fs API that was made to closely resemble the standard Rust experience. At this point, all this code (which was still unable to communicate with any system Archives other than SDMC) results completely pointless to keep around (and even quite confusing).

If we ever need to implement the general libctru file-system functionality into ctru-rs, we should do it by either writing a completely new API that fits the needs nicely, or work to make the already existing std::fs API interoperable with more Archives, just how it already works with SDMC and ROMFS (an idea that was already thought of in the old days).

ian-h-chamberlain commented 9 months ago

Btw, it looks like there might be some renewed interest in updated std::fs::path APIs for prefixes too (https://github.com/rust-lang/rust/issues/52331), which would be nice if we could develop some kinds of PathExt, FileExt in the upstream stdlibs.