# File functions

The file functions make queries to metadata and make validations in files and are available for components that support Double Braces expressions. To know how to provide information to the components using this resource, refer to [Double Braces Functions](/documentation/connectors-and-triggers/double-braces/double-braces-functions.md).

## FILEEXISTS <a href="#fileexists" id="fileexists"></a>

Checks if a file exists in the virtual directory of the pipeline deployment.

### **Syntax**

```
FILEEXISTS(file)
```

* **file:** name of the file in the virtual directory of the pipeline

The function returns `true` when the file is found and `false` when it's not found.

## FILESIZE <a href="#filesize" id="filesize"></a>

Returns the size of a file in the virtual directory of the pipeline deployment.

### **Syntax**

```
FILESIZE(file)
```

* **file:** name of the file in the virtual directory of the pipeline

Let's say you need to obtain the size of the file created one step before the use of the ***File Writer*** component. If its file name configuration in ***File Writer*** was `file.txt`, then use the following extract in the ***JSON Generator*** component:

```
{
"fileSize": {{ FILESIZE("arquivo.txt") }}
}
```

The result would be:

```
{"fileSize": 1000}
```

* **fileSize:** the size of the file (in bytes).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digibee.com/documentation/connectors-and-triggers/double-braces/double-braces-functions/file-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
