Right now we’re using FILE* for file I/O, which works but is a C-style approach. For modern C++20 code, it makes sense to move to std::fstream because it’s safer and more idiomatic.
What needs to be done
- Replace
FILE* usage with std::ifstream / std::ofstream where applicable.
- Remove
FILE* usage from the codebase to reduce unsafe manual management.
Why
- Safer file handling (automatic closing, exception-safe).
- Cleaner, modern C++ style.
- Reduces chances of leaks or undefined behavior from forgetting
fclose.
Things to check
- Make sure nothing breaks for modules still relying on C-style I/O.
Right now we’re using
FILE*for file I/O, which works but is a C-style approach. For modern C++20 code, it makes sense to move tostd::fstreambecause it’s safer and more idiomatic.What needs to be done
FILE*usage withstd::ifstream/std::ofstreamwhere applicable.FILE*usage from the codebase to reduce unsafe manual management.Why
fclose.Things to check