ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/MSBuild_CurrentVersion/Program.cs
(Generate patch)

Comparing trunk/MSBuild_CurrentVersion/Program.cs (file contents):
Revision 191 by william, Mon May 28 10:26:01 2012 UTC vs.
Revision 192 by william, Mon May 28 10:34:02 2012 UTC

--- trunk/MSBuild_CurrentVersion/Program.cs	2012/05/28 10:31:29	191
+++ trunk/MSBuild_CurrentVersion/Program.cs	2012/05/28 10:34:02	192
@@ -25,7 +25,9 @@ namespace MSBuild_CurrentVersion
 
             string version_file = "current-version.txt";
             string full_path = string.Format(@"{0}\{1}", asm_path,version_file);
-            using (FileStream fs = new FileStream(full_path, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite))
+            FileInfo fi = new FileInfo(full_path);
+            if (fi.Exists) fi.Delete();
+            using (FileStream fs = new FileStream(full_path, FileMode.CreateNew, FileAccess.ReadWrite, FileShare.ReadWrite))
             {
                 StreamWriter sw = new StreamWriter(fs);
                 sw.AutoFlush = true;