# pathIsFile (Shared)

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

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

## Syntax

```lua
bool pathIsFile(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 pathIsFile("config.json") then
    local config = fromJSON(fileGetContents("config.json"))
end
```

## See also

- [pathIsDirectory (Shared)](https://wiki.mymp.gg/en/pathIsDirectory.md): Tells whether a path is a folder.
- [fileExists (Shared)](https://wiki.mymp.gg/en/fileExists.md): Tells whether a path is a file. It does the same as pathIsFile.
