Wait to create a new file until the app is ready to write it.
This commit is contained in:
parent
3c129b2505
commit
0c7afb94af
|
@ -11,11 +11,11 @@ namespace Warrecs_2_Extractor
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (br.BaseStream.Position < br.BaseStream.Length)
|
while (br.BaseStream.Position < br.BaseStream.Length)
|
||||||
{
|
{
|
||||||
using FileStream FS = File.Create(Path.GetDirectoryName(args[0]) + "//" + Path.GetExtension(args[0]) + "//" + i);
|
|
||||||
BinaryWriter bw = new(FS);
|
|
||||||
var variable = br.ReadBytes(4);
|
var variable = br.ReadBytes(4);
|
||||||
System.Array.Reverse(variable);
|
System.Array.Reverse(variable);
|
||||||
int size = System.BitConverter.ToInt32(variable, 0);
|
int size = System.BitConverter.ToInt32(variable, 0);
|
||||||
|
using FileStream FS = File.Create(Path.GetDirectoryName(args[0]) + "//" + Path.GetExtension(args[0]) + "//" + i);
|
||||||
|
BinaryWriter bw = new(FS);
|
||||||
bw.Write(br.ReadBytes(size));
|
bw.Write(br.ReadBytes(size));
|
||||||
bw.Close();
|
bw.Close();
|
||||||
i++;
|
i++;
|
||||||
|
|
Loading…
Reference in New Issue