/// <summary>
/// Appends text to a specified file path.
/// </summary>
/// <param name="path">The path of the file.</param>
/// <param name="contents">The contents.</param>
/// <param name="encoding">The encoding to use.</param>
/// <exception cref="ArgumentNullException">
/// <paramref name="path" /> or <paramref name="contents" /> is <see langword="null" /> (<see langword="Nothing" /> in
/// Visual Basic).
/// </exception>
/// <remarks>
/// This operation always requires an encoding to be used. If <paramref name="encoding" /> is set to
/// <see langword="null" />, an implementation-specific
/// encoding will be used.
/// </remarks>
public void AppendAllText(
string path,
string contents,
Encoding?encoding = null)
{
_ = Requires.NotNullOrWhiteSpace(
path,
nameof(path));
_ = Requires.NotNullOrWhiteSpace(
contents,
nameof(contents));
if (encoding == null)
{
FSFile.AppendAllText(
path,
contents);
}
else
{
FSFile.AppendAllText(
path,
contents,
encoding);
}
}