예제 #1
0
 public static bool IsReparsePoint(string path)
 {
     Validate.IsNotNullAndNotEmpty(path, "path");
     if (Directory.Exists(path))
     {
         try
         {
             return((uint)(File.GetAttributes(path) & FileAttributes.ReparsePoint) > 0U);
         }
         catch (FileNotFoundException)
         {
         }
         catch (DirectoryNotFoundException)
         {
         }
     }
     return(false);
 }
예제 #2
0
        public static bool ContainsReparsePoint(string path, string pathRoot = null)
        {
            Validate.IsNotNullAndNotEmpty(path, "path");
            string path1 = path;
            string str   = string.Empty;

            if (pathRoot != null)
            {
                str = GetCommonPathPrefix(path, pathRoot);
            }
            for (; path1 != null && path1.Length > str.Length; path1 = Path.GetDirectoryName(path1))
            {
                if (IsReparsePoint(path1))
                {
                    return(true);
                }
            }
            return(false);
        }