11-03-2013, 09:07 AM
Probably there are symbolic links. A symbolic link is similar to a shortcut (.lnk) file. Unlike with a shortcut, FE_Dir and most Windows API functions see the symbolic link as it would be a real folder, and enumerates files in it. Therefore FE_Dir can enter the same real folder 2 or more times (directly and through symbolic links).
FE_Dir and other QM functions don't have an option to skip symbolic links. Need to create new function, much work, I cannot find an easy workaround. Would need to skip folders that have attribute FILE_ATTRIBUTE_REPARSE_POINT. Probably will add such option in next QM.
Most symbolic links are hidden, unless unchecked "Hide protected OS files" in Folder Options.
Macro Show symbolic links
FE_Dir and other QM functions don't have an option to skip symbolic links. Need to create new function, much work, I cannot find an easy workaround. Would need to skip folders that have attribute FILE_ATTRIBUTE_REPARSE_POINT. Probably will add such option in next QM.
Most symbolic links are hidden, unless unchecked "Hide protected OS files" in Folder Options.
Macro Show symbolic links
;This macro shows all symbolic links in C:\.
;If black, FE_Dir will get files in the target folder. If red, will not get.
out
Dir d
foreach(d "C:\*" FE_Dir 1|4)
,int a=d.FileAttributes
,if(a&FILE_ATTRIBUTE_REPARSE_POINT)
,,str s=d.FileName(1)
,,WIN32_FIND_DATA fd
,,int fh=FindFirstFile(F"{s}\*" &fd)
,,if(fh=-1) out F"<><c 0xff>{s} ({_s.dllerror})</c>"
,,else FindClose(fh); out s