FileSystemExtensions.

Exist(IFileSystem, DirectoryPath) Method

Summary

Determines if a specified DirectoryPath exist.
Namespace
Cake.Core.IO
Containing Type
FileSystemExtensions

Syntax

public static bool Exist(this IFileSystem fileSystem, DirectoryPath path)

Examples

if (context.FileSystem.Exist(new DirectoryPath("./artifacts")))
{
    Information("Artifacts directory exists");
}

Parameters

Name Type Description
fileSystem IFileSystem The file system.
path DirectoryPath The path.

Return Value

Type Description
bool Whether or not the specified directory exist.