<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <!-- Documenting T:NAnt.Core.Tasks.AvailableTask--> <head> <meta http-equiv="Content-Language" content="en-ca" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="../style.css" /> <title><available> Task</title> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="2" class="NavBar"> <tr> <td class="NavBar-Cell"> <a href="http://nant.sourceforge.net"> <b>NAnt</b> </a> <img alt="->" src="../images/arrow.gif" /> <a href="../index.html">Help</a> <img alt="->" src="../images/arrow.gif" /> <a href="../tasks/index.html">Task Reference</a> <img alt="->" src="../images/arrow.gif" /> <available></td> <td class="NavBar-Cell" align="right"> v0.91</td> </tr> </table> <h1><available></h1> <p> <i>(Deprecated)</i> </p> <p> Checks if a resource is available at runtime. </p> <p> The specified property is set to <b>true</b> if the requested resource is available at runtime, and <b>false</b> if the resource is not available. </p> <p class="i2"> <b>Note:</b> we advise you to use the following functions instead: </p> <div class="table"> <table> <tr> <th>Function</th> <th>Description</th> </tr> <tr> <td> <a href="../functions/file.exists(System.String).html">file::exists()</a> </td> <td>Determines whether the specified file exists.</td> </tr> <tr> <td> <a href="../functions/directory.exists(System.String).html">directory::exists()</a> </td> <td>Determines whether the given path refers to an existing directory on disk.</td> </tr> <tr> <td> <a href="../functions/framework.exists(System.String).html">framework::exists()</a> </td> <td>Checks whether the specified framework exists..</td> </tr> <tr> <td> <a href="../functions/framework.sdk-exists(System.String).html">framework::sdk-exists()</a> </td> <td>Checks whether the SDK for the specified framework is installed.</td> </tr> </table> </div> <h3>Parameters</h3> <div class="table"> <table> <tr> <th>Attribute</th> <th style="text-align: center;">Type</th> <th>Description</th> <th style="text-align: center;">Required</th> </tr> <tr> <td valign="top" class="required">property</td> <td style="text-align: center;">string</td> <td> The property that must be set if the resource is available. </td> <td style="text-align: center;">True</td> </tr> <tr> <td valign="top" class="required">resource</td> <td style="text-align: center;">string</td> <td> The resource which must be available. </td> <td style="text-align: center;">True</td> </tr> <tr> <td valign="top" class="required">type</td> <td style="text-align: center;"> <a href="../enums/NAnt.Core.Tasks.AvailableTask.ResourceType.html">ResourceType</a> </td> <td> The type of resource which must be present. </td> <td style="text-align: center;">True</td> </tr> <tr> <td valign="top">failonerror</td> <td style="text-align: center;">bool</td> <td> Determines if task failure stops the build, or is just reported. The default is <b>true</b>. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">if</td> <td style="text-align: center;">bool</td> <td> If <b>true</b> then the task will be executed; otherwise, skipped. The default is <b>true</b>. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">unless</td> <td style="text-align: center;">bool</td> <td> Opposite of <code>if</code>. If <b>false</b> then the task will be executed; otherwise, skipped. The default is <b>false</b>. </td> <td style="text-align: center;">False</td> </tr> <tr> <td valign="top">verbose</td> <td style="text-align: center;">bool</td> <td> Determines whether the task should report detailed build log messages. The default is <b>false</b>. </td> <td style="text-align: center;">False</td> </tr> </table> </div> <h3>Examples</h3> <ul class="examples"> <li> <p> Sets the <code>myfile.present</code> property to <b>true</b> if the file is available on the filesystem and <b>false</b> if the file is not available. </p> <pre class="code"> <available type="File" resource="myfile.txt" property="myfile.present" /> </pre> </li> <li> <p> Sets the <code>build.dir.present</code> property to <b>true</b> if the directory is available on the filesystem and <b>false</b> if the directory is not available. </p> <pre class="code"> <available type="Directory" resource="build" property="build.dir.present" /> </pre> </li> <li> <p> Sets the <code>mono-0.21.framework.present</code> property to <b>true</b> if the Mono 0.21 framework is available on the current system and <b>false</b> if the framework is not available. </p> <pre class="code"> <available type="Framework" resource="mono-0.21" property="mono-0.21.framework.present" /> </pre> </li> <li> <p> Sets the <code>net-1.1.frameworksdk.present</code> property to <b>true</b> if the .NET 1.1 Framework SDK is available on the current system and <b>false</b> if the SDK is not available. </p> <pre class="code"> <available type="FrameworkSDK" resource="net-1.1" property="net-1.1.frameworksdk.present" /> </pre> </li> </ul> <h3>Requirements</h3> <div style="margin-left: 20px;"> <b>Assembly:</b> NAnt.Core (0.91.4312.0) </div> </body> </html>