Beispiel #1
0
        public static bool IsSymbolicLink(string path)
        {
            using (SafeFileHandle handle = ReparsePoint.OpenReparsePoint(path, ReparsePoint.EFileAccess.GenericRead))
            {
                var data = ReparsePoint.GetReparseData(handle);
                if (data == null)
                {
                    return(false);
                }

                return(data.Value.ReparseTag == ReparsePoint.IO_SYMOBOLIC_LINK_TAG);
            }
        }