/// <summary> /// Check if dir is a system directory and should be left alone. /// </summary> public static bool IsSystemDirectory(DirectoryInfo dir) { return(DirectoryBlacklist.Any(y => y.Equals(dir.Name, StringComparison.InvariantCultureIgnoreCase)) || (dir.Attributes & FileAttributes.System) == FileAttributes.System); }
/// <summary> /// Check if dir is a system directory and should be left alone. /// </summary> public static bool IsSystemDirectory(DirectoryInfo dir) { return //dir.Name.StartsWith("Windows ") //Probably overkill (DirectoryBlacklist.Any(y => y.Equals(dir.Name, StringComparison.InvariantCultureIgnoreCase)) || (dir.Attributes & FileAttributes.System) == FileAttributes.System); }
/// <summary> /// Check if dir is a system directory and should be left alone. /// </summary> public static bool IsSystemDirectory(DirectoryInfo dir) { return((dir.Attributes & FileAttributes.System) == FileAttributes.System || dir.FullName.StartsWith(WindowsDirectory, StringComparison.OrdinalIgnoreCase) || DirectoryBlacklist.Any(y => y.Equals(dir.Name, StringComparison.InvariantCultureIgnoreCase))); }