Wait to create the extraction folder until it's needed

This commit is contained in:
NintenHero 2024-03-17 14:58:00 -05:00 committed by GitHub
parent c46854eaf7
commit 9a636d181d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,6 @@ using System.IO.Compression;
FileStream input = File.OpenRead(args[0]);
BinaryReader br = new(input);
Directory.CreateDirectory(Path.GetDirectoryName(args[0]) + "\\" + Path.GetFileNameWithoutExtension(args[0]));
if (new string(br.ReadChars(7)) != "D-PACK2")
throw new Exception("Not a ASURA dat file.");
@ -24,6 +23,7 @@ for (int i = 0; i < fileCount; i++)
});
}
Directory.CreateDirectory(Path.GetDirectoryName(args[0]) + "\\" + Path.GetFileNameWithoutExtension(args[0]));
foreach (SUBFILE subfile in subfiles)
{
br.BaseStream.Position = subfile.start;