Directory Operations aliases

Built-In

Contains extension methods for working with directories.

General

Directory(string) Gets a directory path from string.

Clean

CleanDirectories(GlobPattern, CleanDirectorySettings) Cleans the directories matching the specified pattern. Cleaning the directory will remove all its content but not the directory itself.
CleanDirectories(GlobPattern, Func<IFileSystemInfo, bool>, CleanDirectorySettings) Cleans the directories matching the specified pattern. Cleaning the directory will remove all its content but not the directory itself.
CleanDirectories(GlobPattern, Func<IFileSystemInfo, bool>) Cleans the directories matching the specified pattern. Cleaning the directory will remove all its content but not the directory itself.
CleanDirectories(GlobPattern) Cleans the directories matching the specified pattern. Cleaning the directory will remove all its content but not the directory itself.
CleanDirectories(IEnumerable<DirectoryPath>, CleanDirectorySettings) Cleans the specified directories. Cleaning a directory will remove all its content but not the directory itself.
CleanDirectories(IEnumerable<DirectoryPath>) Cleans the specified directories. Cleaning a directory will remove all its content but not the directory itself.
CleanDirectories(IEnumerable<string>, CleanDirectorySettings) Cleans the specified directories. Cleaning a directory will remove all its content but not the directory itself.
CleanDirectories(IEnumerable<string>) Cleans the specified directories. Cleaning a directory will remove all its content but not the directory itself.
CleanDirectory(DirectoryPath, CleanDirectorySettings) Cleans the specified directory.
CleanDirectory(DirectoryPath, Func<IFileSystemInfo, bool>, CleanDirectorySettings) Cleans the specified directory.
CleanDirectory(DirectoryPath, Func<IFileSystemInfo, bool>) Cleans the specified directory.
CleanDirectory(DirectoryPath) Cleans the specified directory.

Copy

CopyDirectory(DirectoryPath, DirectoryPath) Copies the contents of a directory, including subdirectories to the specified location.

Create

CreateDirectory(DirectoryPath) Creates the specified directory.

Delete

DoesNotExist

EnsureDirectoryDoesNotExist(DirectoryPath, DeleteDirectorySettings) Deletes the specified directory if it exists.
EnsureDirectoryDoesNotExist(DirectoryPath, EnsureDirectoryDoesNotExistSettings) Deletes the specified directory if it exists.
EnsureDirectoryDoesNotExist(DirectoryPath) Deletes the specified directory and its contents if it exists.

Exists

DirectoryExists(DirectoryPath) Determines whether the given path refers to an existing directory.
EnsureDirectoryExists(DirectoryPath) Creates the specified directory if it does not exist.

List

GetSubDirectories(DirectoryPath) Gets a list of all the directories inside a directory.

Move

MoveDirectory(DirectoryPath, DirectoryPath) Moves an existing directory to a new location, providing the option to specify a new directory name.

Path

ExpandEnvironmentVariables(DirectoryPath) Expands all environment variables in the provided DirectoryPath.
MakeAbsolute(DirectoryPath) Makes the path absolute (if relative) using the current working directory.
MakeRelative(DirectoryPath, DirectoryPath) Makes the directory path relative (if absolute) to a specified root directory. If no root directory is defined the current working directory is used as default root.
MakeRelative(FilePath, DirectoryPath) Makes the file path relative (if absolute) to a specified root directory. If no root directory is defined the current working directory is used as default root.