public void WriteFile(FdsWriteOptions option, string filenameAppend) { if (HasHeader || Corrupt) { Console.WriteLine("File has header or is corrupt/not a valid fds image"); return; } if (option == FdsWriteOptions.WriteNewFile) { FdsUtility.ByteArrayToFile( FilePath.Replace(".fds", filenameAppend + ".fds"), FdsUtility.Combine(_header, _data)); Console.WriteLine("File Written"); } if (option == FdsWriteOptions.BackupOriginal) { File.Copy(FilePath, FilePath.Replace(".fds", filenameAppend + ".fds")); Console.WriteLine("Original backed up"); } if (option == FdsWriteOptions.ModifyInPlace) { File.Delete(FilePath); FdsUtility.ByteArrayToFile(FilePath, FdsUtility.Combine(_header, _data)); Console.WriteLine("File Written"); } }
public void WriteFile() { if (!HasHeader && !Corrupt) { File.Copy(FilePath, FilePath.Replace(".fds", "_noheader.fds")); File.Delete(FilePath); FdsUtility.ByteArrayToFile(FilePath, FdsUtility.Combine(_header, _data)); Console.WriteLine("File written."); return; } Console.WriteLine("File has header or is corrupt/not a valid fds image"); }