Explorar o código

ENH: For sanity, create directory before creating generated file stream

Andy Cedilnik %!s(int64=20) %!d(string=hai) anos
pai
achega
b59dd02911
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      Source/cmGeneratedFileStream.cxx

+ 3 - 0
Source/cmGeneratedFileStream.cxx

@@ -146,6 +146,9 @@ void cmGeneratedFileStreamBase::Open(const char* name)
 
   // Make sure the temporary file that will be used is not present.
   cmSystemTools::RemoveFile(m_TempName.c_str());
+
+  std::string dir = cmSystemTools::GetFilenamePath(m_TempName);
+  cmSystemTools::MakeDirectory(dir.c_str());
 }
 
 //----------------------------------------------------------------------------