mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
Thanks .NET Framework
This commit is contained in:
@@ -832,7 +832,7 @@ namespace ArchiSteamFarm {
|
||||
Directory.CreateDirectory(targetBackupDirectory);
|
||||
|
||||
string targetBackupFile = Path.Combine(targetBackupDirectory, fileName);
|
||||
File.Move(file, targetBackupFile, true);
|
||||
RuntimeCompatibility.File.Move(file, targetBackupFile, true);
|
||||
}
|
||||
|
||||
// We can now get rid of directories that are empty
|
||||
@@ -849,7 +849,7 @@ namespace ArchiSteamFarm {
|
||||
if (File.Exists(file)) {
|
||||
// This is possible only with files that we decided to leave in place during our backup function
|
||||
string targetBackupFile = file + ".bak";
|
||||
File.Move(file, targetBackupFile, true);
|
||||
RuntimeCompatibility.File.Move(file, targetBackupFile, true);
|
||||
}
|
||||
|
||||
// Check if this file requires its own folder
|
||||
|
||||
@@ -64,6 +64,20 @@ namespace ArchiSteamFarm {
|
||||
await System.IO.File.AppendAllTextAsync(path, contents).ConfigureAwait(false);
|
||||
#endif
|
||||
|
||||
#pragma warning disable IDE0022
|
||||
public static void Move([NotNull] string sourceFileName, [NotNull] string destFileName, bool overwrite) {
|
||||
#if NETFRAMEWORK
|
||||
if (System.IO.File.Exists(destFileName)) {
|
||||
System.IO.File.Delete(destFileName);
|
||||
}
|
||||
|
||||
System.IO.File.Move(sourceFileName, destFileName);
|
||||
#else
|
||||
System.IO.File.Move(sourceFileName, destFileName, overwrite);
|
||||
#endif
|
||||
}
|
||||
#pragma warning restore IDE0022
|
||||
|
||||
[ItemNotNull]
|
||||
public static async Task<byte[]> ReadAllBytesAsync([NotNull] string path) =>
|
||||
#if NETFRAMEWORK
|
||||
|
||||
Reference in New Issue
Block a user