NAnt SDK Documentation - v0.92

FileFunctions.Exists Method 

Determines whether the specified file exists.

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

Parameters

file
The file to check.

Return Value

true if file refers to an existing file; otherwise, false.

Example

Execute a set of tasks, if file "output.xml" does not exist.

    
<if test="${not file::exists('output.xml')}">
    ...
</if>
    
  

See Also

FileFunctions Class | NAnt.Core.Functions Namespace