Directory Operations

Summary

Contains extension methods for working with directories.

General
Directory(string)​ Gets a directory path from string.
Clean

CleanDirectories(string)​

Cleans the directories matching the specified pattern. Cleaning the directory will remove all its content but not the directory itself.

CleanDirectories(string, ​Func<IFileSystemInfo,​ bool>)​

Cleans the directories matching the specified pattern. Cleaning the 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>)​

Cleans the specified directories. Cleaning a directory will remove all its content but not the directory itself.

CleanDirectory(DirectoryPath)​

Cleans the specified directory.

CleanDirectory(DirectoryPath, ​Func<IFileSystemInfo,​ bool>)​

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

DeleteDirectories(IEnumerable<DirectoryPath>, ​bool)​

Deletes the specified directories.

DeleteDirectories(IEnumerable<string>, ​bool)​

Deletes the specified directories.

DeleteDirectory(DirectoryPath, ​bool)​

Deletes the specified directory.
Exists

EnsureDirectoryExists(DirectoryPath)​

Creates the specified directory if it does not exist.

DirectoryExists(DirectoryPath)​

Determines whether the given path refers to an existing directory.
Move

MoveDirectory(DirectoryPath, ​DirectoryPath)​

Moves an existing directory to a new location, providing the option to specify a new directory name.
Path

MakeAbsolute(DirectoryPath)​

Makes the path absolute (if relative) using the current working directory.