views:

58

answers:

1

Hello,

I've been looking at the windows 7 symlinks (using mklink) [Ed.- they are also supported on Vista, WS2003, WS2008], and I was wondering if it were possible to programmatically determine if a folder were a symlink. Thanks for any help.

~ Steve

+3  A: 

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.

Joey