// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved. using System; using System.Collections.Generic; using System.Text; using System.IO; namespace UnrealBuildTool { public class ResponseFile { /// /// Creates a file from a list of strings; each string is placed on a line in the file. /// /// Name of response file /// List of lines to write to the response file public static string Create(string TempFileName, List Lines) { // @todo fastubt: Make sure we aren't spitting out response files more often than we have to. Also look at Unity.cpp files, injected .cpp files, etc. FileInfo TempFileInfo = new FileInfo( TempFileName ); // Delete the existing file if it exists if( TempFileInfo.Exists ) { TempFileInfo.IsReadOnly = false; TempFileInfo.Delete(); TempFileInfo.Refresh(); } FileItem.CreateIntermediateTextFile(TempFileName, string.Join(Environment.NewLine, Lines)); return TempFileName; } } }