# fileDelete (Shared)

> Deletes a file of the calling resource.

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

## Syntax

```lua
bool fileDelete(string path)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `path` | `string` | A path inside the calling resource. |

## Returns

`true` if the file was deleted; `false` if it does not exist, is a folder or could not be deleted.

A path may not contain `..`, `\` or `:`, nor start with `/`. Another resource's files can only be read; an invalid path logs a warning and the function returns `false`.

## Example

```lua
if fileExists("cache.json") then
    fileDelete("cache.json")
end
```

## See also

- [fileExists (Shared)](https://wiki.mymp.gg/en/fileExists.md): Tells whether a path is a file. It does the same as pathIsFile.
- [fileRename (Shared)](https://wiki.mymp.gg/en/fileRename.md): Renames or moves a file within the calling resource. Folders missing at the destination are created.
