This repository has been archived on 2022-08-05. You can view files and clone it, but cannot push or open issues or pull requests.
CC-Functions/Misc/IO.cs

20 lines
608 B
C#
Raw Normal View History

2020-03-13 19:19:55 +01:00
using System;
using System.IO;
2019-11-29 21:42:39 +01:00
namespace CC_Functions.Misc
{
public static class IO
{
public static long GetDirectorySize(string path)
{
2019-12-22 16:58:16 +01:00
string[] a = Directory.GetFiles(path, "*.*", SearchOption.AllDirectories);
long size = 0;
for (int i = 0; i < a.Length; i++) size += new FileInfo(a[i]).Length;
return size;
2019-11-29 21:42:39 +01:00
}
2020-03-13 19:19:55 +01:00
public static bool CheckPathEqual(string path1, string path2) =>
Path.GetFullPath(path1)
.Equals(Path.GetFullPath(path2), StringComparison.InvariantCultureIgnoreCase);
2019-11-29 21:42:39 +01:00
}
}