# <available>

(Deprecated)

Checks if a resource is available at runtime.

The specified property is set to true if the requested resource is available at runtime, and false if the resource is not available.

Note: we advise you to use the following functions instead:

Function | Description
--- | ---
file::exists() | Determines whether the specified file exists.
directory::exists() | Determines whether the given path refers to an existing directory on disk.
framework::exists() | Checks whether the specified framework exists..
framework::sdk-exists() | Checks whether the SDK for the specified framework is installed.

### Parameters

Attribute | Type | Description | Required
--- | --- | --- | ---
property | string | The property that must be set if the resource is available. | True
resource | string | The resource which must be available. | True
type | ResourceType | The type of resource which must be present. | True
failonerror | bool | Determines if task failure stops the build, or is just reported. The default is true. | False
if | bool | If true then the task will be executed; otherwise, skipped. The default is true. | False
unless | bool | Opposite of `if`. If false then the task will be executed; otherwise, skipped. The default is false. | False
verbose | bool | Determines whether the task should report detailed build log messages. The default is false. | False

### Examples

- Sets the `myfile.present` property to true if the file is available on the filesystem and false if the file is not available.

      <available type="File" resource="myfile.txt" property="myfile.present" />

- Sets the `build.dir.present` property to true if the directory is available on the filesystem and false if the directory is not available.

      <available type="Directory" resource="build" property="build.dir.present" />

- Sets the `mono-0.21.framework.present` property to true if the Mono 0.21 framework is available on the current system and false if the framework is not available.

      <available type="Framework" resource="mono-0.21" property="mono-0.21.framework.present" />

- Sets the `net-1.1.frameworksdk.present` property to true if the .NET 1.1 Framework SDK is available on the current system and false if the SDK is not available.

      <available type="FrameworkSDK" resource="net-1.1" property="net-1.1.frameworksdk.present" />

### Requirements

Assembly: NAnt.Core (0.90.3780.0)