DirectoryFunctions.

GetName(string) Method

Summary

Retrieves the directory name of the specified path.
Assembly
NAnt.Core.dll
Namespace
NAnt.Core.Functions
Containing Type
DirectoryFunctions

Syntax

[Function("get-name")]
public string GetName(string path)

Examples

Gets directory name "test" from full path string.

<property name="test.dir" value="${directory::get-name('C:\Temp\bin\test')}" />

Attributes

Type Description
FunctionAttribute Indicates that the method should be exposed as a function in NAnt build files.

Parameters

Name Type Description
path string The directory's full path. The path parameter can be a file name, including a file on a Universal Naming Convention (UNC) share.

Return Value

Type Description
string A string containing the name of the directory.