Diffusion .NET Classic API - Core and Common  5.9.4
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
PushTechnology.DiffusionCore.LongPath.LongPathDirectory Class Reference

Provides methods for creating, deleting, moving and enumerating directories and subdirectories with long paths, that is, paths that exceed 259 characters. More...

Static Public Member Functions

static void Create (string path)
 Creates the specified directory. More...
 
static void Delete (string path)
 Deletes the specified empty directory. More...
 
static bool Exists (string path)
 Returns a value indicating whether the specified path refers to an existing directory. More...
 
static IEnumerable< string > EnumerateDirectories (string path)
 Returns a enumerable containing the directory names of the specified directory. More...
 
static IEnumerable< string > EnumerateDirectories (string path, string searchPattern)
 Returns a enumerable containing the directory names of the specified directory that match the specified search pattern. More...
 
static IEnumerable< string > EnumerateFiles (string path)
 Returns a enumerable containing the file names of the specified directory. More...
 
static IEnumerable< string > EnumerateFiles (string path, string searchPattern)
 Returns a enumerable containing the file names of the specified directory that match the specified search pattern. More...
 
static IEnumerable< string > EnumerateFileSystemEntries (string path)
 Returns a enumerable containing the file and directory names of the specified directory. More...
 
static IEnumerable< string > EnumerateFileSystemEntries (string path, string searchPattern)
 Returns a enumerable containing the file and directory names of the specified directory that match the specified search pattern. More...
 

Detailed Description

Provides methods for creating, deleting, moving and enumerating directories and subdirectories with long paths, that is, paths that exceed 259 characters.

Member Function Documentation

static void PushTechnology.DiffusionCore.LongPath.LongPathDirectory.Create ( string  path)
static

Creates the specified directory.

Parameters
pathA string containing the path of the directory to create.
Exceptions
ArgumentNullExceptionpath is .
ArgumentExceptionpath is an empty string (""), contains only white space, or contains one or more invalid characters as defined in Path.GetInvalidPathChars().

-or-

path contains one or more components that exceed the drive-defined maximum length. For example, on Windows-based platforms, components must not exceed 255 characters.

Exceptions
PathTooLongExceptionpath exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 32,000 characters.
DirectoryNotFoundExceptionpath contains one or more directories that could not be found.
UnauthorizedAccessExceptionThe caller does not have the required access permissions.
IOExceptionpath is a file.

-or-

path specifies a device that is not ready.

Note: Unlike Directory.CreateDirectory(System.String), this method only creates the last directory in path .

static void PushTechnology.DiffusionCore.LongPath.LongPathDirectory.Delete ( string  path)
static

Deletes the specified empty directory.

Parameters
pathA String containing the path of the directory to delete.
Exceptions
ArgumentNullExceptionpath is .
ArgumentExceptionpath is an empty string (""), contains only white space, or contains one or more invalid characters as defined in Path.GetInvalidPathChars().

-or-

path contains one or more components that exceed the drive-defined maximum length. For example, on Windows-based platforms, components must not exceed 255 characters.

Exceptions
PathTooLongExceptionpath exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 32,000 characters.
DirectoryNotFoundExceptionpath could not be found.
UnauthorizedAccessExceptionThe caller does not have the required access permissions.

-or-

path refers to a directory that is read-only.

Exceptions
IOExceptionpath is a file.

-or-

path refers to a directory that is not empty.

-or-

path refers to a directory that is in use.

-or-

path specifies a device that is not ready.

static IEnumerable<string> PushTechnology.DiffusionCore.LongPath.LongPathDirectory.EnumerateDirectories ( string  path)
static

Returns a enumerable containing the directory names of the specified directory.

Parameters
pathA String containing the path of the directory to search.
Returns
A IEnumerable{T} containing the directory names within path .
Exceptions
ArgumentNullExceptionpath is .
ArgumentExceptionpath is an empty string (""), contains only white space, or contains one or more invalid characters as defined in Path.GetInvalidPathChars().

-or-

path contains one or more components that exceed the drive-defined maximum length. For example, on Windows-based platforms, components must not exceed 255 characters.

Exceptions
PathTooLongExceptionpath exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 32,000 characters.
DirectoryNotFoundExceptionpath contains one or more directories that could not be found.
UnauthorizedAccessExceptionThe caller does not have the required access permissions.
IOExceptionpath is a file.

-or-

path specifies a device that is not ready.

static IEnumerable<string> PushTechnology.DiffusionCore.LongPath.LongPathDirectory.EnumerateDirectories ( string  path,
string  searchPattern 
)
static

Returns a enumerable containing the directory names of the specified directory that match the specified search pattern.

Parameters
pathA String containing the path of the directory to search.
searchPatternA String containing search pattern to match against the names of the directories in path , otherwise, or an empty string ("") to use the default search pattern, "*".
Returns
A IEnumerable{T} containing the directory names within path that match searchPattern .
Exceptions
ArgumentNullExceptionpath is .
ArgumentExceptionpath is an empty string (""), contains only white space, or contains one or more invalid characters as defined in Path.GetInvalidPathChars().

-or-

path contains one or more components that exceed the drive-defined maximum length. For example, on Windows-based platforms, components must not exceed 255 characters.

Exceptions
PathTooLongExceptionpath exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 32,000 characters.
DirectoryNotFoundExceptionpath contains one or more directories that could not be found.
UnauthorizedAccessExceptionThe caller does not have the required access permissions.
IOExceptionpath is a file.

-or-

path specifies a device that is not ready.

static IEnumerable<string> PushTechnology.DiffusionCore.LongPath.LongPathDirectory.EnumerateFiles ( string  path)
static

Returns a enumerable containing the file names of the specified directory.

Parameters
pathA String containing the path of the directory to search.
Returns
A IEnumerable{T} containing the file names within path .
Exceptions
ArgumentNullExceptionpath is .
ArgumentExceptionpath is an empty string (""), contains only white space, or contains one or more invalid characters as defined in Path.GetInvalidPathChars().

-or-

path contains one or more components that exceed the drive-defined maximum length. For example, on Windows-based platforms, components must not exceed 255 characters.

Exceptions
PathTooLongExceptionpath exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 32,000 characters.
DirectoryNotFoundExceptionpath contains one or more directories that could not be found.
UnauthorizedAccessExceptionThe caller does not have the required access permissions.
IOExceptionpath is a file.

-or-

path specifies a device that is not ready.

static IEnumerable<string> PushTechnology.DiffusionCore.LongPath.LongPathDirectory.EnumerateFiles ( string  path,
string  searchPattern 
)
static

Returns a enumerable containing the file names of the specified directory that match the specified search pattern.

Parameters
pathA String containing the path of the directory to search.
searchPatternA String containing search pattern to match against the names of the files in path , otherwise, or an empty string ("") to use the default search pattern, "*".
Returns
A IEnumerable{T} containing the file names within path that match searchPattern .
Exceptions
ArgumentNullExceptionpath is .
ArgumentExceptionpath is an empty string (""), contains only white space, or contains one or more invalid characters as defined in Path.GetInvalidPathChars().

-or-

path contains one or more components that exceed the drive-defined maximum length. For example, on Windows-based platforms, components must not exceed 255 characters.

Exceptions
PathTooLongExceptionpath exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 32,000 characters.
DirectoryNotFoundExceptionpath contains one or more directories that could not be found.
UnauthorizedAccessExceptionThe caller does not have the required access permissions.
IOExceptionpath is a file.

-or-

path specifies a device that is not ready.

static IEnumerable<string> PushTechnology.DiffusionCore.LongPath.LongPathDirectory.EnumerateFileSystemEntries ( string  path)
static

Returns a enumerable containing the file and directory names of the specified directory.

Parameters
pathA String containing the path of the directory to search.
Returns
A IEnumerable{T} containing the file and directory names within path .
Exceptions
ArgumentNullExceptionpath is .
ArgumentExceptionpath is an empty string (""), contains only white space, or contains one or more invalid characters as defined in Path.GetInvalidPathChars().

-or-

path contains one or more components that exceed the drive-defined maximum length. For example, on Windows-based platforms, components must not exceed 255 characters.

Exceptions
PathTooLongExceptionpath exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 32,000 characters.
DirectoryNotFoundExceptionpath contains one or more directories that could not be found.
UnauthorizedAccessExceptionThe caller does not have the required access permissions.
IOExceptionpath is a file.

-or-

path specifies a device that is not ready.

static IEnumerable<string> PushTechnology.DiffusionCore.LongPath.LongPathDirectory.EnumerateFileSystemEntries ( string  path,
string  searchPattern 
)
static

Returns a enumerable containing the file and directory names of the specified directory that match the specified search pattern.

Parameters
pathA String containing the path of the directory to search.
searchPatternA String containing search pattern to match against the names of the files and directories in path , otherwise, or an empty string ("") to use the default search pattern, "*".
Returns
A IEnumerable{T} containing the file and directory names within path that match searchPattern .
Exceptions
ArgumentNullExceptionpath is .
ArgumentExceptionpath is an empty string (""), contains only white space, or contains one or more invalid characters as defined in Path.GetInvalidPathChars().

-or-

path contains one or more components that exceed the drive-defined maximum length. For example, on Windows-based platforms, components must not exceed 255 characters.

Exceptions
PathTooLongExceptionpath exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 32,000 characters.
DirectoryNotFoundExceptionpath contains one or more directories that could not be found.
UnauthorizedAccessExceptionThe caller does not have the required access permissions.
IOExceptionpath is a file.

-or-

path specifies a device that is not ready.

static bool PushTechnology.DiffusionCore.LongPath.LongPathDirectory.Exists ( string  path)
static

Returns a value indicating whether the specified path refers to an existing directory.

Parameters
pathA String containing the path to check.
Returns
if path refers to an existing directory; otherwise, .

Note that this method will return false if any error occurs while trying to determine if the specified directory exists. This includes situations that would normally result in thrown exceptions including (but not limited to); passing in a directory name with invalid or too many characters, an I/O error such as a failing or missing disk, or if the caller does not have Windows or Code Access Security (CAS) permissions to to read the directory.