mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[SimpleSort] Add header support, fix scan levels
This commit is contained in:
@@ -608,7 +608,7 @@ namespace SabreTools.Helper
|
||||
long adjustedLength = br.BaseStream.Length - bytesToRemoveFromTail;
|
||||
|
||||
// Seek to the correct position
|
||||
br.BaseStream.Seek(bytesToRemoveFromHead, SeekOrigin.Begin);
|
||||
br.BaseStream.Seek((bytesToRemoveFromHead < 0 ? 0 : bytesToRemoveFromHead), SeekOrigin.Begin);
|
||||
|
||||
// Now read the file in chunks and write out
|
||||
byte[] buffer = new byte[bufferSize];
|
||||
@@ -695,5 +695,22 @@ namespace SabreTools.Helper
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy a file to a new location, creating directories as needed
|
||||
/// </summary>
|
||||
/// <param name="input">Input filename</param>
|
||||
/// <param name="output">Output filename</param>
|
||||
public static void CopyFileToNewLocation(string input, string output)
|
||||
{
|
||||
if (File.Exists(input) && !File.Exists(output))
|
||||
{
|
||||
if (!Directory.Exists(Path.GetDirectoryName(output)))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(output));
|
||||
}
|
||||
File.Copy(input, output);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user