NAnt SDK Documentation - v0.92 |

# DirectoryFunctions.Exists Method

Determines whether the given path refers to an existing directory on disk.

[Visual Basic]
<Function(Name:="exists")>
Public Function Exists( _
ByVal path As String _
) As Boolean
[C#]
[Function(Name="exists")]
public bool Exists(
string path
);

#### Parameters

path
  The path to test.

#### Return Value

true if path refers to an existing directory; otherwise, false.

#### Example

Remove directory "test", if it exists.

    <delete dir="test" if="${directory::exists('test')}" />

#### See Also

DirectoryFunctions Class | NAnt.Core.Functions Namespace