A tiny C++23 filesystem wrapper that returns std::expected instead of throwing
Hi everyone,
I’ve been working on a small C++23 header-only library called expected_fs:
https://github.com/MrZLeo/expected-fs
It’s a thin wrapper around std::filesystem where fallible operations return std::expected<T, std::error_code> instead of throwing std::filesystem_error.
The idea is not to replace std::filesystem, but to make filesystem code easier to compose in projects that prefer explicit error handling.
Example:
int
Most function names mirror std::filesystem, so usage should feel familiar:
auto created = ;
auto copied = ;
auto removed = ;
It's simple and it just work. I’d love feedback on the API shape, naming, CMake packaging, and whether this feels useful to people who avoid exception-based filesystem handling.
Thanks for taking a look! :)