mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 13:15:07 +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);
|
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