diff --git a/SabreTools.Helper/Tools/ArchiveTools.cs b/SabreTools.Helper/Tools/ArchiveTools.cs index eecd9b87..82f48560 100644 --- a/SabreTools.Helper/Tools/ArchiveTools.cs +++ b/SabreTools.Helper/Tools/ArchiveTools.cs @@ -1043,9 +1043,15 @@ namespace SabreTools.Helper // Now get the Rom info for the file so we have hashes and size Rom rom = FileTools.GetFileInfo(input, logger); - // If it doesn't exist, create the output file and then write + // Get the output file name string outfile = Path.Combine(outDir, rom.SHA1 + ".gz"); + // If the output file exists, don't try to write again + if (File.Exists(outfile)) + { + return true; + } + // Compress the input stream FileStream inputStream = File.OpenRead(input); GZipStream outputStream = new GZipStream(File.Open(outfile, FileMode.Create, FileAccess.Write), CompressionMode.Compress);