开发者

List MyDocuments Directory Files strange output

开发者 https://www.devze.com 2022-12-09 20:54 出处:网络
I\'m using Windows 7 and I\'m trying to list all the files in MyDocu开发者_运维技巧ments. I get the path with

I'm using Windows 7 and I'm trying to list all the files in MyDocu开发者_运维技巧ments. I get the path with Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) which is c:/Users/eyalw/Documents

Now I try to list the files with DirectoryInfo.GetFileSystemInfos(), and i get files that are inside the dir + directories from my user home, like My Music, My Pictures, My Videos.

i checked with the command line 'dir', and those dirs are not inside eyalw/Documents so why the hack do i get them?

thanks in advance!


If you look at the Attributes property, you;ll see that these are hidden symlinks (or ReparsePoints) to C:\Users\eyalw\Music, etc.

Windows Vista and Windows 7 create these hidden symlinks in case a program tries to write to My Documents\My Pictures, etc, which existed in Windows XP.

0

精彩评论

暂无评论...
验证码 换一张
取 消