NAnt SDK Documentation - v0.92 |

# PathFunctions.GetDirectoryName Method

Returns the directory information for the specified path string.

[Visual Basic]
<Function(Name:="get-directory-name")>
Public Shared Function GetDirectoryName( _
ByVal path As String _
) As String
[C#]
[Function(Name="get-directory-name")]
public static string GetDirectoryName(
string path
);

#### Parameters

path
  The path of a file or directory.

#### Return Value

A String containing directory information for path, or an empty String if path denotes a root directory, or does not contain directory information.

#### Exceptions

Exception Type | Condition
--- | ---
ArgumentException | path contains invalid characters, is empty, or contains only white spaces.

#### See Also

PathFunctions Class | NAnt.Core.Functions Namespace