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.
Syntax
[CakeMethodAlias]
[CakeAliasCategory("Paths")]
public static IEnumerable<IFileSystemInfo> GetFileSystemInfos(this ICakeContext context, GlobPattern pattern, GlobberSettings settings)
Examples
Func<IFileSystemInfo, bool> exclude_node_modules =
fileSystemInfo => !fileSystemInfo.Path.FullPath.EndsWith(
"node_modules", StringComparison.OrdinalIgnoreCase);
var entries = GetFileSystemInfos("./src/**/*", new GlobberSettings { Predicate = exclude_node_modules });
foreach (var entry in entries)
{
Information("{0}: {1}", entry is IDirectory ? "Directory" : "File", entry.Path);
}
Attributes
Parameters
Return Value
| Type |
Description |
| IEnumerable<IFileSystemInfo> |
The file system entries matching the specified pattern. |