mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
File open/write async flag enabled. 1MB buffer
This commit is contained in:
parent
04d69299ec
commit
2e3b25ee69
@ -397,14 +397,14 @@ namespace Wabbajack.Common
|
||||
{
|
||||
var path = _path;
|
||||
return CircuitBreaker.WithAutoRetryAsync<FileStream, IOException>(async () =>
|
||||
File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite));
|
||||
File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, bufferSize: 1048576, useAsync: true));
|
||||
}
|
||||
|
||||
public ValueTask<FileStream> WriteShared()
|
||||
{
|
||||
var path = _path;
|
||||
return CircuitBreaker.WithAutoRetryAsync<FileStream, IOException>(async () =>
|
||||
File.Open(path, FileMode.Open, FileAccess.Write, FileShare.ReadWrite));
|
||||
File.Open(path, FileMode.Open, FileAccess.Write, FileShare.ReadWrite, bufferSize: 1048576, useAsync: true));
|
||||
}
|
||||
|
||||
public async Task CopyDirectoryToAsync(AbsolutePath destination)
|
||||
|
@ -1098,13 +1098,6 @@ namespace Wabbajack.Common
|
||||
return bytes;
|
||||
}
|
||||
|
||||
public static async Task CopyFileAsync(string src, string dest)
|
||||
{
|
||||
await using var s = File.OpenRead(src);
|
||||
await using var d = File.Create(dest);
|
||||
await s.CopyToAsync(d);
|
||||
}
|
||||
|
||||
public static string ToNormalString(this SecureString value)
|
||||
{
|
||||
var valuePtr = IntPtr.Zero;
|
||||
|
Loading…
Reference in New Issue
Block a user