![]() |
Diffusion .NET Classic API - Core and Common
5.9.4
|
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... | |
Provides methods for creating, deleting, moving and enumerating directories and subdirectories with long paths, that is, paths that exceed 259 characters.
|
static |
Creates the specified directory.
path | A string containing the path of the directory to create. |
ArgumentNullException | path is . |
ArgumentException | path 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.
PathTooLongException | path exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 32,000 characters. |
DirectoryNotFoundException | path contains one or more directories that could not be found. |
UnauthorizedAccessException | The caller does not have the required access permissions. |
IOException | path 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 |
Deletes the specified empty directory.
path | A String containing the path of the directory to delete. |
ArgumentNullException | path is . |
ArgumentException | path 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.
PathTooLongException | path exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 32,000 characters. |
DirectoryNotFoundException | path could not be found. |
UnauthorizedAccessException | The caller does not have the required access permissions. |
-or-
path refers to a directory that is read-only.
IOException | path 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 |
Returns a enumerable containing the directory names of the specified directory.
path | A String containing the path of the directory to search. |
ArgumentNullException | path is . |
ArgumentException | path 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.
PathTooLongException | path exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 32,000 characters. |
DirectoryNotFoundException | path contains one or more directories that could not be found. |
UnauthorizedAccessException | The caller does not have the required access permissions. |
IOException | path is a file. |
-or-
path specifies a device that is not ready.
|
static |
Returns a enumerable containing the directory names of the specified directory that match the specified search pattern.
path | A String containing the path of the directory to search. |
searchPattern | A 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, "*". |
ArgumentNullException | path is . |
ArgumentException | path 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.
PathTooLongException | path exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 32,000 characters. |
DirectoryNotFoundException | path contains one or more directories that could not be found. |
UnauthorizedAccessException | The caller does not have the required access permissions. |
IOException | path is a file. |
-or-
path specifies a device that is not ready.
|
static |
Returns a enumerable containing the file names of the specified directory.
path | A String containing the path of the directory to search. |
ArgumentNullException | path is . |
ArgumentException | path 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.
PathTooLongException | path exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 32,000 characters. |
DirectoryNotFoundException | path contains one or more directories that could not be found. |
UnauthorizedAccessException | The caller does not have the required access permissions. |
IOException | path is a file. |
-or-
path specifies a device that is not ready.
|
static |
Returns a enumerable containing the file names of the specified directory that match the specified search pattern.
path | A String containing the path of the directory to search. |
searchPattern | A 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, "*". |
ArgumentNullException | path is . |
ArgumentException | path 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.
PathTooLongException | path exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 32,000 characters. |
DirectoryNotFoundException | path contains one or more directories that could not be found. |
UnauthorizedAccessException | The caller does not have the required access permissions. |
IOException | path is a file. |
-or-
path specifies a device that is not ready.
|
static |
Returns a enumerable containing the file and directory names of the specified directory.
path | A String containing the path of the directory to search. |
ArgumentNullException | path is . |
ArgumentException | path 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.
PathTooLongException | path exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 32,000 characters. |
DirectoryNotFoundException | path contains one or more directories that could not be found. |
UnauthorizedAccessException | The caller does not have the required access permissions. |
IOException | path is a file. |
-or-
path specifies a device that is not ready.
|
static |
Returns a enumerable containing the file and directory names of the specified directory that match the specified search pattern.
path | A String containing the path of the directory to search. |
searchPattern | A 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, "*". |
ArgumentNullException | path is . |
ArgumentException | path 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.
PathTooLongException | path exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 32,000 characters. |
DirectoryNotFoundException | path contains one or more directories that could not be found. |
UnauthorizedAccessException | The caller does not have the required access permissions. |
IOException | path is a file. |
-or-
path specifies a device that is not ready.
|
static |
Returns a value indicating whether the specified path refers to an existing directory.
path | A String containing the path to check. |
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.