コード例 #1
0
ファイル: LongPathCommon.cs プロジェクト: topcss/LongPath
        public static bool Exists(string path, out bool isDirectory)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            string normalizedPath;

            if (LongPathCommon.TryNormalizeLongPath(path, out normalizedPath))
            {
                EFileAttributes attributes;
                if (LongPathCommon.TryGetFileAttributes(normalizedPath, out attributes))
                {
                    isDirectory = LongPathCommon.IsDirectory(attributes);
                    return(true);
                }
            }

            isDirectory = false;
            return(false);
        }