views:

59

answers:

2

I tried to run the following code:

var top = new DirectoryInfo("C:\\");
foreach(var info in top.GetFileSystemInfos())
    System.Console.WriteLine("{0}: {1}", info.Name, info.Attributes);

I got the following result:

$Recycle.Bin: Hidden, System, Directory
ATI: Directory
Documents and Settings: Hidden, System, Directory, ReparsePoint, NotContentIndexed
MSOCache: ReadOnly, Hidden, Directory, NotContentIndexed
PerfLogs: Directory
Program Files: ReadOnly, Directory
Program Files (x86): 65553
ProgramData: 73746
Recovery: Hidden, System, Directory, NotContentIndexed
System Volume Information: Hidden, System, Directory
Users: ReadOnly, Directory
Windows: 65552
hiberfil.sys: Hidden, System, Archive, NotContentIndexed
pagefile.sys: Hidden, System, Archive

Most of those are pretty obvious. But what does those marked in bold mean? Especially the numeric ones for Program Files and Windows.

+1  A: 

I think, this is a sum of attributes from this list: http://msdn.microsoft.com/en-us/library/ee332330%28VS.85%29.aspx

For example, 65552 = 65536 (FILE_ATTRIBUTE_VIRTUAL) + 16 (FILE_ATTRIBUTE_DIRECTORY)

and so on.

VMAtm
A: 

The attributes of FileSystemInfo are taken from FileAttributes, which is an enumeration.

  • The numbers correspond to the sum of adding the various bits together.

  • ReparsePoint means that there's a reparse point on this directory, which causes NTFS to look at some special data that's been stored along with the directory. You can read more about how they work here.

  • NotContentIndexed means that if there's a content-indexing service running, it won't look at this directory.

John Feminella