Elektrine lite

← Feed

@kornel@mastodon.social

Post #1887741

2026-04-30 02:46 UTC

@pid_eins Rust's std::fs and std::io were an MVP for the 1.0 release, and unfortunately mostly stayed like that. Back then Rust still had to prove that the memory safety and data-race guarantees could even work, that it could be stable and backwards-compatible language, while having even bigger unfinished gaps in the language and libstd. Now std::fs sticks out as the weak point, but Rust couldn't take moonshots in every aspect all at once. It would never ship.

Replies (1)

  • @weiznich@social.weiznich.de 2026-04-30 06:05

    @kornel @pid_eins I wonder whether it's still possible to fix that in rust's standard library. One quick and likely silly idea is to change std::path::Path and std::path::PathBuf to also optionally include a file descriptor and prepopulate that one on the first file system related sys-call. That might resolve most of those TOCTOU issues. It likely will break other stuff horribly, so for now that's just an silly idea without much research behind it.

    Open ##1887742