Validation fixes

isTempFIle fix, OutFile vs TempFile moving fix
This commit is contained in:
SciresM
2015-05-16 18:34:12 -07:00
parent 5def103a25
commit 1b1321ee4f

View File

@@ -18,7 +18,7 @@ public class RomFS
public RomFS(string fn)
{
FileName = fn;
isTempFile = false;
isTempFile = true;
using (var fs = File.OpenRead(fn))
{
fs.Seek(0x8, SeekOrigin.Begin);
@@ -223,11 +223,12 @@ internal static void MakeRomFSData(RomfsFile[] RomFiles, MemoryStream metadata,
if (OutFileStream != null)
OutFileStream.Dispose();
}
updateTB(TB_Progress, "RomFS Super Block Hash: " + ByteArrayToString(SuperBlockHash));
updateTB(TB_Progress, "Saving to destination...");
if (File.Exists(OutFile)) File.Delete(OutFile);
File.Move(TempFile, OutFile);
if (OutFile != TempFile)
{
if (File.Exists(OutFile)) File.Delete(OutFile);
File.Move(TempFile, OutFile);
}
}
internal static void WriteBinary(string tempFile, string outFile, RichTextBox TB_Progress = null, ProgressBar PB_Show = null)
{
@@ -801,4 +802,4 @@ public class Output
}
#endregion
}
}
}