public static bool HasAttributes(string fileName, FileAttributes attr) { return ((File.GetAttributes(fileName) & attr) == attr); }