FileAliases.

File(ICakeContext, string) Method

Summary

Gets a file path from string.
Namespace
Cake.Common.IO
Containing Type
FileAliases

Syntax

[CakeMethodAlias]
[CakeNamespaceImport("Cake.Common.IO.Paths")]
public static ConvertableFilePath File(this ICakeContext context, string path)

Examples

 // Get the temp file.
 var root = Directory("./");
 var temp = root + File("temp");

 // Delete the file.
 CleanDirectory(temp);

Attributes

Type Description
CakeMethodAliasAttribute An attribute used to mark script method aliases.
CakeNamespaceImportAttribute An attribute used to hint Cake about additional namespaces that need to be imported for an alias to work. This attribute can mark an extension method, the extension method class, or the assembly to provide a global set of imports.

Parameters

Name Type Description
context ICakeContext The context.
path string The path.

Return Value

Type Description
ConvertableFilePath A file path.