Skip to content

Instantly share code, notes, and snippets.

@natemcmaster
Last active September 1, 2016 19:36
Show Gist options
  • Save natemcmaster/eafee1cb6997084eaaa950cac0d9a16f to your computer and use it in GitHub Desktop.
Save natemcmaster/eafee1cb6997084eaaa950cac0d9a16f to your computer and use it in GitHub Desktop.
Which file attributes?
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