문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top