Provides methods for creating, deleting, moving and enumerating directories and subdirectories with long paths, that is, paths that exceed 259 characters.
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }