NAnt SDK Documentation - v0.85-nightly-2005-11-09

FileFunctions.Exists Method 

[This is preliminary documentation and subject to change.]

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.

Remarks

Missing <remarks> documentation for M:NAnt.Core.Functions.FileFunctions.Exists(System.String)

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