Last active
September 1, 2016 19:36
-
-
Save natemcmaster/eafee1cb6997084eaaa950cac0d9a16f to your computer and use it in GitHub Desktop.
Which file attributes?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
foreach (var file in args) | |
{ | |
var attributes = new FileInfo(file).Attributes; | |
Console.WriteLine(file); | |
foreach (FileAttributes attr in Enum.GetValues(typeof(FileAttributes))) | |
{ | |
if ((attributes & attr) != 0) | |
{ | |
Console.WriteLine(" " + attr.ToString()); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment