---
title: "directoryExists"
canonical: "https://support.appfire.com/space/PSCONF/15303335/directoryExists"
format: markdown
---
> Macro (aura-html)

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | directoryExists(path_to_directory) | **Package** | file |
> | **Alias** |  | **Pkg Usage** | dirExists(path_to_directory) |

## Description

> Macro (excerpt)
> 
> Returns "true" if the directory exists and "false" otherwise.

Returns "true" if the directory exists and "false" otherwise.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | path_to_directory | String | Yes | Specifies the name of the directory to locate. |

## Return Type

**Boolean (true/false)**

## Example

```
if(directoryExists("C:/myDirectory")){
    print("The directory exists!");
} else {
    print("The directory does not exist!");
}
```


> ⚠️ It is recommended that you use forward slashes ( / ) for file paths.

## See also

> Macro (contentbylabel)