From 18e595a5a60fb4b02b1a1b1d46b0fe5aefaee8dd Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Thu, 27 Oct 2011 14:17:39 +0000 Subject: [PATCH] Fix OOS-log paths to work on Windows This was SVN commit r10434. --- source/simulation2/Simulation2.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/simulation2/Simulation2.cpp b/source/simulation2/Simulation2.cpp index 92c08b2afe..669c70aea7 100644 --- a/source/simulation2/Simulation2.cpp +++ b/source/simulation2/Simulation2.cpp @@ -68,7 +68,7 @@ public: RegisterFileReloadFunc(ReloadChangedFileCB, this); -// m_EnableOOSLog = true; // TODO: this should be a command-line flag or similar +// m_EnableOOSLog = true; // TODO: this should be a command-line flag or similar // m_EnableSerializationTest = true; // TODO: this should too } @@ -523,9 +523,11 @@ void CSimulation2Impl::DumpState() { PROFILE("DumpState"); - std::wstringstream name; - name << L"sim_log/" << getpid() << L"/" << std::setw(5) << std::setfill(L'0') << m_TurnNumber << L".txt"; - OsPath path = psLogDir() / name.str(); + std::stringstream pid; + pid << getpid(); + std::stringstream name;\ + name << std::setw(5) << std::setfill('0') << m_TurnNumber << ".txt"; + OsPath path = psLogDir() / "sim_log" / pid.str() / name.str(); CreateDirectories(path.Parent(), 0700); std::ofstream file (OsString(path).c_str(), std::ofstream::out | std::ofstream::trunc);