IsDirectory() static private method

static private IsDirectory ( FileAttributes attributes ) : bool
attributes FileAttributes
return bool
Example #1
0
        internal static int TryGetDirectoryAttributes(string normalizedPath, out FileAttributes attributes)
        {
            var errorCode = TryGetFileAttributes(normalizedPath, out attributes);

            if (!LongPathDirectory.IsDirectory(attributes))
            {
                errorCode = NativeMethods.ERROR_DIRECTORY;
            }

            return(errorCode);
        }
Example #2
0
        internal static bool Exists(Path path, out bool isDirectory)
        {
            string normalizedPath;

            if (TryNormalizeLongPath(path.FullPath, out normalizedPath))
            {
                FileAttributes attributes;
                var            errorCode = TryGetFileAttributes(normalizedPath, out attributes);
                if (errorCode == 0)
                {
                    isDirectory = LongPathDirectory.IsDirectory(attributes);
                    return(true);
                }
            }

            isDirectory = false;
            return(false);
        }