Przeglądaj źródła

Create destination file if it does not exist

Daniele Bartolini 12 lat temu
rodzic
commit
683b9fb233
1 zmienionych plików z 6 dodań i 0 usunięć
  1. 6 0
      tools/compilers/Compiler.cpp

+ 6 - 0
tools/compilers/Compiler.cpp

@@ -75,6 +75,12 @@ Compiler::Compiler(const char* root_path, const char* dest_path, const char* res
 
 	// Open streams
 	m_src_file = (FileStream*)m_root_fs.open(m_resource, SOM_READ);
+
+	if (!m_dest_fs.exists(dest_name))
+	{
+		m_dest_fs.create_file(dest_name);
+	}
+
 	m_dest_file = (FileStream*)m_dest_fs.open(dest_name, SOM_WRITE);
 }