mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Move WriteAllTextSafe to correct location
This commit is contained in:
parent
c305c01dfd
commit
2b2a027fb0
1 changed files with 16 additions and 16 deletions
|
|
@ -609,7 +609,23 @@ public static class Util
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overwrite text in a file by first writing it to a temporary file, and then
|
||||
/// moving that file to the path specified.
|
||||
/// </summary>
|
||||
/// <param name="path">The path of the file to write to.</param>
|
||||
/// <param name="text">The text to write.</param>
|
||||
public static void WriteAllTextSafe(string path, string text)
|
||||
{
|
||||
var tmpPath = path + ".tmp";
|
||||
if (File.Exists(tmpPath))
|
||||
File.Delete(tmpPath);
|
||||
|
||||
File.WriteAllText(tmpPath, text);
|
||||
File.Move(tmpPath, path, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dispose this object.
|
||||
/// </summary>
|
||||
|
|
@ -645,22 +661,6 @@ public static class Util
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overwrite text in a file by first writing it to a temporary file, and then
|
||||
/// moving that file to the path specified.
|
||||
/// </summary>
|
||||
/// <param name="path">The path of the file to write to.</param>
|
||||
/// <param name="text">The text to write.</param>
|
||||
public static void WriteAllTextSafe(string path, string text)
|
||||
{
|
||||
var tmpPath = path + ".tmp";
|
||||
if (File.Exists(tmpPath))
|
||||
File.Delete(tmpPath);
|
||||
|
||||
File.WriteAllText(tmpPath, text);
|
||||
File.Move(tmpPath, path, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a random, inoffensive, human-friendly string.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue