diff --git a/src/Linker/Linker.cpp b/src/Linker/Linker.cpp index c2810445..99cfdb75 100644 --- a/src/Linker/Linker.cpp +++ b/src/Linker/Linker.cpp @@ -444,10 +444,13 @@ class Linker::Impl bool WriteZoneToFile(Zone* zone) { - fs::path zoneFilePath(m_args.GetOutputFolderPathForZone(zone->m_name)); + const fs::path zoneFolderPath(m_args.GetOutputFolderPathForZone(zone->m_name)); + auto zoneFilePath(zoneFolderPath); zoneFilePath.append(zone->m_name + ".ff"); - std::ifstream stream(zoneFilePath); + fs::create_directories(zoneFolderPath); + + std::ofstream stream(zoneFilePath); if (!stream.is_open()) return false;