Unknown FileAttributes
I tri开发者_运维技巧ed 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.
I think, this is a sum of attributes from this list
For example,
65552 = 65536 (FILE_ATTRIBUTE_VIRTUAL) + 16 (FILE_ATTRIBUTE_DIRECTORY)
and so on.
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.
精彩评论