mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-01-11 19:44:55 +00:00
feat: Adding shim for setting file attributes recursively
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user