From 0ead2d300e85b3ef44cb593827b1862e0c1afc88 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Wed, 15 Jul 2009 15:01:55 +0000 Subject: [PATCH] Worked around File.Replace issue on Linux by deleting the existing file first. Not perfectly safe, but acceptable for our use. --- Source/Bind/GL2/Generator.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Source/Bind/GL2/Generator.cs b/Source/Bind/GL2/Generator.cs index 81a90b49..437df6e4 100644 --- a/Source/Bind/GL2/Generator.cs +++ b/Source/Bind/GL2/Generator.cs @@ -554,10 +554,20 @@ namespace Bind.GL2 sw.WriteLine("}"); } - File.Replace(temp_enums_file, Path.Combine(Settings.OutputPath, enumsFile), null); - File.Replace(temp_delegates_file, Path.Combine(Settings.OutputPath, delegatesFile), null); - File.Replace(temp_core_file, Path.Combine(Settings.OutputPath, importsFile), null); - File.Replace(temp_wrappers_file, Path.Combine(Settings.OutputPath, wrappersFile), null); + string output_enums = Path.Combine(Settings.OutputPath, enumsFile); + string output_delegates = Path.Combine(Settings.OutputPath, delegatesFile); + string output_core = Path.Combine(Settings.OutputPath, importsFile); + string output_wrappers = Path.Combine(Settings.OutputPath, wrappersFile); + + if (File.Exists(output_enums)) File.Delete(output_enums); + if (File.Exists(output_delegates)) File.Delete(output_delegates); + if (File.Exists(output_core)) File.Delete(output_core); + if (File.Exists(output_wrappers)) File.Delete(output_wrappers); + + File.Move(temp_enums_file, output_enums); + File.Move(temp_delegates_file, output_delegates); + File.Move(temp_core_file, output_core); + File.Move(temp_wrappers_file, output_wrappers); } #endregion