mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatFile, ArchiveTools, FileTools] Seeking
This commit is contained in:
@@ -537,6 +537,9 @@ namespace SabreTools.Helper.Dats
|
||||
return rebuilt;
|
||||
}
|
||||
|
||||
// Seek to the beginning of the stream
|
||||
fileStream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
Globals.Logger.User("Matches found for '" + Style.GetFileName(rom.Name) + "', rebuilding accordingly...");
|
||||
rebuilt = true;
|
||||
|
||||
|
||||
@@ -1576,6 +1576,7 @@ namespace SabreTools.Helper.Tools
|
||||
if (!File.Exists(archiveFileName))
|
||||
{
|
||||
// Copy the input stream to the output
|
||||
inputStream.Seek(0, SeekOrigin.Begin);
|
||||
tarFile.AddEntry(rom.Name, inputStream);
|
||||
}
|
||||
|
||||
@@ -1624,6 +1625,7 @@ namespace SabreTools.Helper.Tools
|
||||
if (index < 0)
|
||||
{
|
||||
// Copy the input file to the output
|
||||
inputStream.Seek(0, SeekOrigin.Begin);
|
||||
tarFile.AddEntry(rom.Name, inputStream);
|
||||
}
|
||||
|
||||
@@ -1871,6 +1873,9 @@ namespace SabreTools.Helper.Tools
|
||||
return success;
|
||||
}
|
||||
|
||||
// Seek to the beginning of the stream
|
||||
inputStream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
// Get the output archive name from the first rebuild rom
|
||||
string archiveFileName = Path.Combine(outDir, Style.RemovePathUnsafeCharacters(rom.Machine.Name) + (rom.Machine.Name.EndsWith(".7z") ? "" : ".7z"));
|
||||
|
||||
@@ -2442,6 +2447,9 @@ namespace SabreTools.Helper.Tools
|
||||
return success;
|
||||
}
|
||||
|
||||
// Seek to the beginning of the stream
|
||||
inputStream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
// Get the output archive name from the first rebuild rom
|
||||
string archiveFileName = Path.Combine(outDir, Style.RemovePathUnsafeCharacters(rom.Machine.Name) + (rom.Machine.Name.EndsWith(".xz") ? "" : ".xz"));
|
||||
|
||||
@@ -2845,7 +2853,7 @@ namespace SabreTools.Helper.Tools
|
||||
return success;
|
||||
}
|
||||
|
||||
// Set the stream position
|
||||
// Seek to the beginning of the stream
|
||||
inputStream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
// Get the output archive name from the first rebuild rom
|
||||
|
||||
@@ -839,6 +839,9 @@ namespace SabreTools.Helper.Tools
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Seek to the beginning of the stream
|
||||
input.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
if (!keepReadOpen)
|
||||
{
|
||||
input.Dispose();
|
||||
|
||||
Reference in New Issue
Block a user