feat: Adding shim for setting file attributes recursively

This commit is contained in:
Chris Cameron
2021-02-11 11:43:18 -05:00
parent ffb00f960d
commit 456a8f74f9

View File

@@ -120,5 +120,18 @@ namespace ICD.Common.Utils.IO
{
File.Move(sourceFileName, destFileName);
}
#if STANDARD
public static void SetAttributes(string path, FileAttributes attributes, bool recursive)
{
File.SetAttributes(path, attributes);
if (!recursive || !Directory.Exists(path))
return;
foreach (string innerPath in Directory.GetFileSystemEntries(path))
SetAttributes(innerPath, attributes, true);
}
#endif
}
}