# File Exists

This assertion type helps you to verify if a certain directory exists.

## Existing

Provide a TRUE (1) as expected to check that the file should exist.

```yaml
file_exists:
    - name: "SSH Private Key exists"
      file: "/var/www/.ssh/id_rsa"
      expected: 1
```

## Not Existing

Provide a FALSE (0) as expected to check that the file does not exist at all.

```yaml
file_exists:
    - name: "SSH Private Key must not exist"
      file: "/var/www/.ssh/id_rsa"
      expected: 0
```


---

# 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.svrunit.com/assertions/file-exists.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.
