GlobbingAliases.

GetFileSystemInfos(ICakeContext, GlobPattern) Method

Summary

Gets all files and directories matching the specified pattern. This is the entry point for scripts and Frosting, when it is not known whether the matched paths are files or directories.
Namespace
Cake.Common.IO
Containing Type
GlobbingAliases

Syntax

[CakeMethodAlias]
[CakeAliasCategory("Paths")]
public static IEnumerable<IFileSystemInfo> GetFileSystemInfos(this ICakeContext context, GlobPattern pattern)

Examples

var entries = GetFileSystemInfos("./artifacts/*");
foreach (var entry in entries)
{
    Information("{0}: {1}", entry is IDirectory ? "Directory" : "File", entry.Path);
}

Attributes

Type Description
CakeMethodAliasAttribute An attribute used to mark script method aliases.
CakeAliasCategoryAttribute An attribute used for documentation of alias methods/properties.

Parameters

Name Type Description
context ICakeContext The context.
pattern GlobPattern The glob pattern to match.

Return Value

Type Description
IEnumerable<IFileSystemInfo> The file system entries matching the specified pattern.