Reputation: 12004
I've been looking at the Windows 7 symbolic links (using mklink) [Edit - they are also supported on Windows Vista, Windows Server 2003, Windows Server 2008]. Is it possible to programmatically determine if a folder is a symlink?
Upvotes: 1
Views: 566
Reputation: 354456
Use GetFileAttributes and check for FILE_ATTRIBUTE_REPARSE_POINT.
ETA: Since you clarified now that you're doing this from C#, you can do this natively there:
System.IO.File.GetAttributes("some/path")
You can check for the ReparsePoint flag in the returned enum value.
Upvotes: 3