# fileGetSize (Shared)

> Returns an open file's size.

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

## Syntax

```lua
int fileGetSize(file file)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `file` | `file` | A file opened by `fileOpen` or `fileCreate`. |

## Returns

The size in bytes.

## Example

```lua
local file = fileOpen("data.json", true)
local text = fileRead(file, fileGetSize(file))
fileClose(file)
```

## See also

- [fileGetPos (Shared)](https://wiki.mymp.gg/en/fileGetPos.md): Returns a file's current read and write position.
- [fileRead (Shared)](https://wiki.mymp.gg/en/fileRead.md): Reads bytes from a file at the current position and moves the position on.
