diff --git a/libs/io/source/file_stream.cpp b/libs/io/source/file_stream.cpp index 1988078c..8f48b6f3 100644 --- a/libs/io/source/file_stream.cpp +++ b/libs/io/source/file_stream.cpp @@ -1,18 +1,20 @@ #include #include +#include namespace psemek::io { static void throw_fopen [[noreturn]] (std::filesystem::path const & path) { - throw std::runtime_error("Failed to open " + path.native() + ": " + std::string(std::strerror(errno))); + throw std::runtime_error("Failed to open " + path.string() + ": " + std::string(std::strerror(errno))); } static FILE * safe_fopen(std::filesystem::path const & path, const char * mode) { - auto f = std::fopen(path.c_str(), mode); + std::string path_str = path.string(); + auto f = std::fopen(path_str.c_str(), mode); if (!f) throw_fopen(path); return f; }