using System;
using System.IO;
namespace CC_Functions.Misc
{
///
/// IO functions
///
public static class IO
{
///
/// Recursively gets the size of an directory
///
/// The path of the directory
/// The size of the directory
public static long GetDirectorySize(string path)
{
string[] a = Directory.GetFiles(path, "*.*", SearchOption.AllDirectories);
long size = 0;
foreach (string t in a)
size += new FileInfo(t).Length;
return size;
}
///
/// Check whether the paths are equivalent (ignores case)
///
/// The first path to check
/// The second path to check
/// Whether the paths are equal
public static bool CheckPathEqual(string path1, string path2) =>
Path.GetFullPath(path1)
.Equals(Path.GetFullPath(path2), StringComparison.InvariantCultureIgnoreCase);
}
}