# fileExists (Shared)

> Tells whether a path is a file. It does the same as `pathIsFile`.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Files
- **URL**: https://wiki.mymp.gg/en/fileExists

## Syntax

```lua
bool fileExists(string path)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `path` | `string` | A path inside the calling resource, or `@resource/path` for another resource's file. |

## Returns

`true` if the path exists and is a file (not a folder).

## Example

```lua
if fileExists("config.json") then
    local config = fromJSON(fileGetContents("config.json"))
end
```

## See also

- [pathIsFile (Shared)](https://wiki.mymp.gg/en/pathIsFile.md): Tells whether a path is a file. It does the same as fileExists.
- [fileOpen (Shared)](https://wiki.mymp.gg/en/fileOpen.md): Opens a file that already exists, with the position at its start.
